Changeset 81237 in vbox
- Timestamp:
- Oct 14, 2019 6:43:34 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r81232 r81237 4672 4672 if (ASMAtomicUoReadU64(&pVCpu->hm.s.fCtxChanged) & HM_CHANGED_VMX_ENTRY_EXIT_CTLS) 4673 4673 { 4674 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4675 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 4674 PVMCC pVM = pVCpu->CTX_SUFF(pVM); 4675 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 4676 bool const fGstInLongMode = CPUMIsGuestInLongModeEx(&pVCpu->cpum.GstCtx); 4677 4678 /* 4679 * VMRUN function. 4680 */ 4681 { 4682 /* If the guest is in long mode, use the 64-bit guest handler, else the 32-bit guest handler. 4683 * The host is always 64-bit since we no longer support 32-bit hosts. 4684 */ 4685 if (fGstInLongMode) 4686 { 4687 #ifndef VBOX_WITH_64_BITS_GUESTS 4688 return VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE; 4689 #else 4690 Assert(pVM->hm.s.fAllow64BitGuests); /* Guaranteed by hmR3InitFinalizeR0(). */ 4691 pVmcsInfo->pfnStartVM = VMXR0StartVM64; 4692 #endif 4693 } 4694 else 4695 pVmcsInfo->pfnStartVM = VMXR0StartVM32; 4696 } 4676 4697 4677 4698 /* … … 4700 4721 * here rather than while merging the guest VMCS controls. 4701 4722 */ 4702 if ( CPUMIsGuestInLongModeEx(&pVCpu->cpum.GstCtx))4723 if (fGstInLongMode) 4703 4724 { 4704 4725 Assert(pVCpu->cpum.GstCtx.msrEFER & MSR_K6_EFER_LME); … … 6517 6538 } 6518 6539 6519 return VINF_SUCCESS;6520 }6521 6522 6523 /**6524 * Selects up the appropriate function to run guest code.6525 *6526 * @returns VBox status code.6527 * @param pVCpu The cross context virtual CPU structure.6528 * @param pVmxTransient The VMX-transient structure.6529 *6530 * @remarks No-long-jump zone!!!6531 */6532 static int hmR0VmxSelectVMRunHandler(PVMCPUCC pVCpu, PCVMXTRANSIENT pVmxTransient)6533 {6534 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx;6535 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;6536 6537 if (CPUMIsGuestInLongModeEx(pCtx))6538 {6539 #ifndef VBOX_WITH_64_BITS_GUESTS6540 return VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE;6541 #else6542 Assert(pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests); /* Guaranteed by hmR3InitFinalizeR0(). */6543 /* Guest is in long mode, use the 64-bit handler (host is 64-bit). */6544 pVmcsInfo->pfnStartVM = VMXR0StartVM64;6545 #endif6546 }6547 else6548 {6549 /* Guest is not in long mode, use the 32-bit handler. */6550 pVmcsInfo->pfnStartVM = VMXR0StartVM32;6551 }6552 Assert(pVmcsInfo->pfnStartVM);6553 6540 return VINF_SUCCESS; 6554 6541 } … … 9049 9036 * Ideally, assert that the cross-dependent bits are up-to-date at the point of using it. 9050 9037 */ 9051 /** @todo r=ramshankar: Move hmR0VmxSelectVMRunHandler inside 9052 * hmR0VmxExportGuestEntryExitCtls and do it conditionally. There shouldn't 9053 * be a need to evaluate this everytime since I'm pretty sure we intercept 9054 * all guest paging mode changes. */ 9055 int rc = hmR0VmxSelectVMRunHandler(pVCpu, pVmxTransient); 9056 AssertLogRelMsgRCReturn(rc, ("rc=%Rrc\n", rc), rc); 9057 9058 rc = hmR0VmxExportGuestEntryExitCtls(pVCpu, pVmxTransient); 9038 int rc = hmR0VmxExportGuestEntryExitCtls(pVCpu, pVmxTransient); 9059 9039 AssertLogRelMsgRCReturn(rc, ("rc=%Rrc\n", rc), rc); 9060 9040
Note:
See TracChangeset
for help on using the changeset viewer.