Changeset 8878 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 16, 2008 10:59:52 AM (17 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCMInternal.h
r8876 r8878 206 206 /** Set by the ring-0 driver to indicate SVM is supported by the CPU. */ 207 207 bool fSupported; 208 209 208 /** Set when we've enabled SVM. */ 210 209 bool fEnabled; 211 212 210 /** Set if we don't have to flush the TLB on VM entry. */ 213 211 bool fResumeVM; … … 216 214 /** Set if we need to flush the TLB during the world switch. */ 217 215 bool fForceTLBFlush; 216 217 /* Id of the last cpu we were executing code on (NIL_RTCPUID for the first time) */ 218 RTCPUID idLastCpu; 218 219 219 220 /** R0 memory object for the VM control block (VMCB). */ … … 330 331 typedef HWACCM *PHWACCM; 331 332 332 static struct333 {334 struct335 {336 RTR0MEMOBJ pMemObj;337 bool fVMXConfigured;338 bool fSVMConfigured;339 } aCpuInfo[RTCPUSET_MAX_CPUS];340 341 struct342 {343 /** Set by the ring-0 driver to indicate VMX is supported by the CPU. */344 bool fSupported;345 346 /** Host CR4 value (set by ring-0 VMX init) */347 uint64_t hostCR4;348 349 /** VMX MSR values */350 struct351 {352 uint64_t feature_ctrl;353 uint64_t vmx_basic_info;354 uint64_t vmx_pin_ctls;355 uint64_t vmx_proc_ctls;356 uint64_t vmx_exit;357 uint64_t vmx_entry;358 uint64_t vmx_misc;359 uint64_t vmx_cr0_fixed0;360 uint64_t vmx_cr0_fixed1;361 uint64_t vmx_cr4_fixed0;362 uint64_t vmx_cr4_fixed1;363 uint64_t vmx_vmcs_enum;364 } msr;365 /* Last instruction error */366 uint32_t ulLastInstrError;367 } vmx;368 struct369 {370 /** Set by the ring-0 driver to indicate SVM is supported by the CPU. */371 bool fSupported;372 373 /** SVM revision. */374 uint32_t u32Rev;375 376 /** Maximum ASID allowed. */377 uint32_t u32MaxASID;378 379 /** SVM feature bits from cpuid 0x8000000a */380 uint32_t u32Features;381 } svm;382 /** Saved error from detection */383 int32_t lLastError;384 385 struct386 {387 uint32_t u32AMDFeatureECX;388 uint32_t u32AMDFeatureEDX;389 } cpuid;390 391 HWACCMSTATE enmHwAccmState;392 } HWACCMR0GLOBALS;393 394 333 typedef struct 395 334 { -
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r8876 r8878 705 705 CPUMCTX *pCtx; 706 706 int rc; 707 RTCPUID idCpu = RTMpCpuId(); 707 708 708 709 rc = CPUMQueryGuestCtxPtr(pVM, &pCtx); … … 730 731 { 731 732 Assert(pVM->hwaccm.s.svm.fSupported); 732 rc = SVMR0Enter(pVM );733 rc = SVMR0Enter(pVM, &HWACCMR0Globals.aCpuInfo[idCpu]); 733 734 AssertRC(rc); 734 735 rc |= SVMR0LoadGuestState(pVM, pCtx); -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r8876 r8878 188 188 } 189 189 190 /* Invalidate the last cpu we were running on. */ 191 pVM->hwaccm.s.svm.idLastCpu = NIL_RTCPUID; 190 192 return VINF_SUCCESS; 191 193 } … … 1643 1645 * @returns VBox status code. 1644 1646 * @param pVM The VM to operate on. 1647 * @param pCpu CPU info struct 1645 1648 */ 1646 HWACCMR0DECL(int) SVMR0Enter(PVM pVM )1649 HWACCMR0DECL(int) SVMR0Enter(PVM pVM, PHWACCM_CPUINFO pCpu) 1647 1650 { 1648 1651 Assert(pVM->hwaccm.s.svm.fSupported); 1649 1652 1650 /* Force a TLB flush on VM entry. */ 1651 pVM->hwaccm.s.svm.fForceTLBFlush = true; 1653 if (pVM->hwaccm.s.svm.idLastCpu != pCpu->idCpu) 1654 { 1655 /* Force a TLB flush on VM entry. */ 1656 pVM->hwaccm.s.svm.fForceTLBFlush = true; 1657 } 1658 pVM->hwaccm.s.svm.idLastCpu = pCpu->idCpu; 1652 1659 1653 1660 pVM->hwaccm.s.svm.fResumeVM = false; -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.h
r8876 r8878 47 47 * @returns VBox status code. 48 48 * @param pVM The VM to operate on. 49 * @param pCpu CPU info struct 49 50 */ 50 HWACCMR0DECL(int) SVMR0Enter(PVM pVM );51 HWACCMR0DECL(int) SVMR0Enter(PVM pVM, PHWACCM_CPUINFO pCpu); 51 52 52 53 /**
Note:
See TracChangeset
for help on using the changeset viewer.