Skip to content

Commit c175405

Browse files
VMM/VMMR3/target-x86/NEMR3Native-linux-x86.cpp: Don't query MSR_K8_TSC_AUX if the extension is not available, github:gh-603
svn:sync-xref-src-repo-rev: r173511
1 parent 663aea3 commit c175405

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

src/VBox/VMM/VMMR3/target-x86/NEMR3Native-linux-x86.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: NEMR3Native-linux-x86.cpp 113606 2026-03-27 07:25:58Z alexander.eichner@oracle.com $ */
1+
/* $Id: NEMR3Native-linux-x86.cpp 113739 2026-04-07 06:27:57Z alexander.eichner@oracle.com $ */
22
/** @file
33
* NEM - Native execution manager, native ring-3 Linux backend.
44
*/
@@ -1395,12 +1395,19 @@ VMM_INT_DECL(int) NEMHCQueryCpuTick(PVMCPUCC pVCpu, uint64_t *pcTicks, uint32_t
13951395
uBuf.Core.entries[0].index = MSR_IA32_TSC;
13961396
uBuf.Core.entries[0].reserved = 0;
13971397
uBuf.Core.entries[0].data = UINT64_MAX;
1398-
uBuf.Core.entries[1].index = MSR_K8_TSC_AUX;
1399-
uBuf.Core.entries[1].reserved = 0;
1400-
uBuf.Core.entries[1].data = UINT64_MAX;
1398+
1399+
if ( g_CpumHostFeatures.s.fRdTscP
1400+
&& puAux)
1401+
{
1402+
uBuf.Core.entries[1].index = MSR_K8_TSC_AUX;
1403+
uBuf.Core.entries[1].reserved = 0;
1404+
uBuf.Core.entries[1].data = 0;
1405+
uBuf.Core.nmsrs = 2;
1406+
}
1407+
else
1408+
uBuf.Core.nmsrs = 1;
14011409

14021410
uBuf.Core.pad = 0;
1403-
uBuf.Core.nmsrs = 2;
14041411
int rc = ioctl(pVCpu->nem.s.fdVCpu, KVM_GET_MSRS, &uBuf);
14051412
AssertMsgReturn(rc == 2,
14061413
("rc=%d iMsr=%d (->%#x) errno=%d\n",

0 commit comments

Comments
 (0)