Changeset 52672 in vbox
- Timestamp:
- Sep 10, 2014 11:27:22 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMMinimal.cpp
r52247 r52672 25 25 #include <iprt/err.h> 26 26 #include <iprt/asm-amd64-x86.h> 27 #include <iprt/string.h> 27 28 28 29 #include <VBox/vmm/cpum.h> 29 30 #include <VBox/vmm/vm.h> 31 #include <VBox/vmm/tm.h> 32 #include <VBox/vmm/pdmapi.h> 30 33 31 34 /******************************************************************************* … … 43 46 CPUMSetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_HVP); 44 47 48 /* 49 * Expose a generic hypervisor-agnostic leaf (originally defined VMware). 50 * The leaves range from 0x40000010 to 0x400000FF. 51 */ 52 CPUMCPUIDLEAF HyperLeaf; 53 int rc = CPUMR3CpuIdGetLeaf(pVM, &HyperLeaf, 0x40000000, 0 /* uSubLeaf */); 54 if (RT_SUCCESS(rc)) 55 { 56 HyperLeaf.uEax = UINT32_C(0x40000010); /* Maximum leaf we implement. */ 57 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf); 58 AssertLogRelRCReturn(rc, rc); 59 60 /* 61 * Add the timing information hypervisor leaf. 62 * MacOS X uses this to determine the TSC, bus frequency. See @bugref{7270}. 63 * 64 * EAX - TSC frequency in KHz. 65 * EBX - APIC frequency in KHz. 66 * ECX, EDX - Reserved. 67 */ 68 uint64_t uApicFreq; 69 rc = PDMApicGetTimerFreq(pVM, &uApicFreq); 70 AssertLogRelRCReturn(rc, rc); 71 72 RT_ZERO(HyperLeaf); 73 HyperLeaf.uLeaf = UINT32_C(0x40000010); 74 HyperLeaf.uEax = TMCpuTicksPerSecond(pVM) / UINT64_C(1000); 75 HyperLeaf.uEbx = uApicFreq / UINT64_C(1000); 76 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf); 77 AssertLogRelRCReturn(rc, rc); 78 } 79 45 80 return VINF_SUCCESS; 46 81 }
Note:
See TracChangeset
for help on using the changeset viewer.