Changeset 72208 in vbox for trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
- Timestamp:
- May 15, 2018 4:11:35 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r72178 r72208 59 59 } while (0) 60 60 61 # ifdef VBOX_WITH_NESTED_HWVIRT 61 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM 62 62 # define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { \ 63 63 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); \ … … 70 70 #else 71 71 # define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0) 72 # ifdef VBOX_WITH_NESTED_HWVIRT 72 # ifdef VBOX_WITH_NESTED_HWVIRT_SVM 73 73 # define HMSVM_NESTED_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { } while (0) 74 74 # endif … … 83 83 * \#VMEXIT intercepts that maybe caused during delivering of another 84 84 * event in the guest. */ 85 #ifdef VBOX_WITH_NESTED_HWVIRT 85 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 86 86 # define HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY() \ 87 87 do \ … … 139 139 140 140 /** Assert that we're not executing a nested-guest. */ 141 #ifdef VBOX_WITH_NESTED_HWVIRT 141 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 142 142 # define HMSVM_ASSERT_NOT_IN_NESTED_GUEST(a_pCtx) Assert(!CPUMIsGuestInSvmNestedHwVirtMode((a_pCtx))) 143 143 #else … … 146 146 147 147 /** Assert that we're executing a nested-guest. */ 148 #ifdef VBOX_WITH_NESTED_HWVIRT 148 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 149 149 # define HMSVM_ASSERT_IN_NESTED_GUEST(a_pCtx) Assert(CPUMIsGuestInSvmNestedHwVirtMode((a_pCtx))) 150 150 #else … … 370 370 static FNSVMEXITHANDLER hmR0SvmExitXcptAC; 371 371 static FNSVMEXITHANDLER hmR0SvmExitXcptBP; 372 #if defined(HMSVM_ALWAYS_TRAP_ALL_XCPTS) || defined(VBOX_WITH_NESTED_HWVIRT )372 #if defined(HMSVM_ALWAYS_TRAP_ALL_XCPTS) || defined(VBOX_WITH_NESTED_HWVIRT_SVM) 373 373 static FNSVMEXITHANDLER hmR0SvmExitXcptGeneric; 374 374 #endif 375 #ifdef VBOX_WITH_NESTED_HWVIRT 375 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 376 376 static FNSVMEXITHANDLER hmR0SvmExitXcptPFNested; 377 377 static FNSVMEXITHANDLER hmR0SvmExitClgi; … … 387 387 388 388 static int hmR0SvmHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PSVMTRANSIENT pSvmTransient); 389 #ifdef VBOX_WITH_NESTED_HWVIRT 389 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 390 390 static int hmR0SvmHandleExitNested(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient); 391 391 #endif … … 757 757 { 758 758 PVM pVM = pVCpu->CTX_SUFF(pVM); 759 #ifdef VBOX_WITH_NESTED_HWVIRT 759 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 760 760 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 761 761 { … … 780 780 { 781 781 PVM pVM = pVCpu->CTX_SUFF(pVM); 782 #ifdef VBOX_WITH_NESTED_HWVIRT 782 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 783 783 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 784 784 { … … 803 803 { 804 804 PVM pVM = pVCpu->CTX_SUFF(pVM); 805 #ifdef VBOX_WITH_NESTED_HWVIRT 805 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 806 806 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 807 807 { … … 847 847 if (!fInNestedGuestMode) 848 848 *pbMsrBitmap &= ~RT_BIT(uMsrpmBit); 849 #ifdef VBOX_WITH_NESTED_HWVIRT 849 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 850 850 else 851 851 { … … 867 867 if (!fInNestedGuestMode) 868 868 *pbMsrBitmap &= ~RT_BIT(uMsrpmBit + 1); 869 #ifdef VBOX_WITH_NESTED_HWVIRT 869 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 870 870 else 871 871 { … … 903 903 bool const fUseLbrVirt = fLbrVirt; /** @todo CFGM, IEM implementation etc. */ 904 904 905 #ifdef VBOX_WITH_NESTED_HWVIRT 905 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 906 906 bool const fVirtVmsaveVmload = RT_BOOL(pVM->hm.s.svm.u32Features & X86_CPUID_SVM_FEATURE_EDX_VIRT_VMSAVE_VMLOAD); 907 907 bool const fUseVirtVmsaveVmload = fVirtVmsaveVmload && pVM->hm.s.svm.fVirtVmsaveVmload && pVM->hm.s.fNestedPaging; … … 953 953 #endif 954 954 955 #ifdef VBOX_WITH_NESTED_HWVIRT 955 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 956 956 /* Virtualized VMSAVE/VMLOAD. */ 957 957 pVmcbCtrl->LbrVirt.n.u1VirtVmsaveVmload = fUseVirtVmsaveVmload; … … 1087 1087 DECLINLINE(PSVMVMCB) hmR0SvmGetCurrentVmcb(PVMCPU pVCpu, PCPUMCTX pCtx) 1088 1088 { 1089 #ifdef VBOX_WITH_NESTED_HWVIRT 1089 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1090 1090 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 1091 1091 return pCtx->hwvirt.svm.CTX_SUFF(pVmcb); … … 1106 1106 DECLINLINE(PSVMNESTEDVMCBCACHE) hmR0SvmGetNestedVmcbCache(PVMCPU pVCpu, PCPUMCTX pCtx) 1107 1107 { 1108 #ifdef VBOX_WITH_NESTED_HWVIRT 1108 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1109 1109 Assert(pCtx->hwvirt.svm.fHMCachedVmcb); RT_NOREF(pCtx); 1110 1110 return &pVCpu->hm.s.svm.NstGstVmcbCache; … … 1165 1165 static void hmR0SvmFlushTaggedTlb(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMVMCB pVmcb, PHMGLOBALCPUINFO pHostCpu) 1166 1166 { 1167 #ifndef VBOX_WITH_NESTED_HWVIRT 1167 #ifndef VBOX_WITH_NESTED_HWVIRT_SVM 1168 1168 RT_NOREF(pCtx); 1169 1169 #endif … … 1184 1184 if ( pVCpu->hm.s.idLastCpu != pHostCpu->idCpu 1185 1185 || pVCpu->hm.s.cTlbFlushes != pHostCpu->cTlbFlushes 1186 #ifdef VBOX_WITH_NESTED_HWVIRT 1186 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1187 1187 || CPUMIsGuestInSvmNestedHwVirtMode(pCtx) 1188 1188 #endif … … 1411 1411 { 1412 1412 bool fRemove = true; 1413 #ifdef VBOX_WITH_NESTED_HWVIRT 1413 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1414 1414 /* Only remove the intercept if the nested-guest is also not intercepting it! */ 1415 1415 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) … … 1467 1467 { 1468 1468 bool fRemove = true; 1469 #ifdef VBOX_WITH_NESTED_HWVIRT 1469 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1470 1470 /* Only remove the control intercept if the nested-guest is also not intercepting it! */ 1471 1471 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) … … 1989 1989 1990 1990 1991 #ifdef VBOX_WITH_NESTED_HWVIRT 1991 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 1992 1992 /** 1993 1993 * Loads the nested-guest APIC state (currently just the TPR). … … 2146 2146 2147 2147 2148 #ifdef VBOX_WITH_NESTED_HWVIRT 2148 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 2149 2149 /** 2150 2150 * Merges guest and nested-guest intercepts for executing the nested-guest using … … 2406 2406 pVmcb->guest.u64RAX = pCtx->rax; 2407 2407 2408 #ifdef VBOX_WITH_NESTED_HWVIRT 2408 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 2409 2409 if (pVmcb->ctrl.IntCtrl.n.u1VGifEnable) 2410 2410 { … … 2449 2449 2450 2450 2451 #ifdef VBOX_WITH_NESTED_HWVIRT 2451 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 2452 2452 /** 2453 2453 * Merges the guest and nested-guest MSR permission bitmap. … … 2628 2628 pVmcbNstGst->guest.u64RAX = pCtx->rax; 2629 2629 2630 #ifdef VBOX_WITH_NESTED_HWVIRT 2630 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 2631 2631 Assert(!pVmcbNstGst->ctrl.IntCtrl.n.u1VGifEnable); /* Nested VGIF not supported yet. */ 2632 2632 #endif … … 2660 2660 return rc; 2661 2661 } 2662 #endif /* VBOX_WITH_NESTED_HWVIRT */2662 #endif /* VBOX_WITH_NESTED_HWVIRT_SVM */ 2663 2663 2664 2664 … … 2731 2731 2732 2732 PCSVMVMCBCTRL pVmcbCtrl = &pVmcb->ctrl; 2733 #ifdef VBOX_WITH_NESTED_HWVIRT 2733 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 2734 2734 if (!CPUMIsGuestInSvmNestedHwVirtMode(pMixedCtx)) 2735 2735 { … … 3495 3495 * VINTR intercept all being set. 3496 3496 */ 3497 #ifdef VBOX_WITH_NESTED_HWVIRT 3497 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 3498 3498 /* 3499 3499 * Currently we don't overlay interupt windows and if there's any V_IRQ pending … … 3547 3547 } 3548 3548 3549 #ifdef VBOX_WITH_NESTED_HWVIRT 3549 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 3550 3550 /** 3551 3551 * Evaluates the event to be delivered to the nested-guest and sets it as the … … 3679 3679 Assert(pVmcb); 3680 3680 3681 #ifdef VBOX_WITH_NESTED_HWVIRT 3681 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 3682 3682 bool const fGif = pCtx->hwvirt.fGif; 3683 3683 #else … … 4099 4099 4100 4100 4101 #ifdef VBOX_WITH_NESTED_HWVIRT 4101 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4102 4102 /** 4103 4103 * Does the preparations before executing nested-guest code in AMD-V. … … 4120 4120 HMSVM_ASSERT_IN_NESTED_GUEST(pCtx); 4121 4121 4122 #ifdef VBOX_WITH_NESTED_HWVIRT_ ONLY_IN_IEM4122 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM_ONLY_IN_IEM 4123 4123 Log2(("hmR0SvmPreRunGuest: Rescheduling to IEM due to nested-hwvirt or forced IEM exec -> VINF_EM_RESCHEDULE_REM\n")); 4124 4124 return VINF_EM_RESCHEDULE_REM; … … 4468 4468 4469 4469 4470 #ifdef VBOX_WITH_NESTED_HWVIRT 4470 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4471 4471 /** 4472 4472 * Undoes the TSC offset applied for an SVM nested-guest and returns the TSC … … 4790 4790 } 4791 4791 4792 #ifdef VBOX_WITH_NESTED_HWVIRT 4792 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4793 4793 /** 4794 4794 * Runs the nested-guest code using AMD-V. … … 4899 4899 uint32_t cLoops = 0; 4900 4900 int rc; 4901 #ifdef VBOX_WITH_NESTED_HWVIRT 4901 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4902 4902 if (!CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 4903 4903 #endif … … 4908 4908 rc = hmR0SvmRunGuestCodeStep(pVM, pVCpu, pCtx, &cLoops); 4909 4909 } 4910 #ifdef VBOX_WITH_NESTED_HWVIRT 4910 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4911 4911 else 4912 4912 { … … 4937 4937 4938 4938 4939 #ifdef VBOX_WITH_NESTED_HWVIRT 4939 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 4940 4940 /** 4941 4941 * Determines whether an IOIO intercept is active for the nested-guest or not. … … 5554 5554 } 5555 5555 5556 #ifdef VBOX_WITH_NESTED_HWVIRT 5556 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 5557 5557 case SVM_EXIT_CLGI: return hmR0SvmExitClgi(pVCpu, pCtx, pSvmTransient); 5558 5558 case SVM_EXIT_STGI: return hmR0SvmExitStgi(pVCpu, pCtx, pSvmTransient); … … 6121 6121 6122 6122 6123 #ifdef VBOX_WITH_NESTED_HWVIRT 6123 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 6124 6124 /** 6125 6125 * Gets the length of the current instruction if the CPU supports the NRIP_SAVE … … 7544 7544 7545 7545 7546 #if defined(HMSVM_ALWAYS_TRAP_ALL_XCPTS) || defined(VBOX_WITH_NESTED_HWVIRT )7546 #if defined(HMSVM_ALWAYS_TRAP_ALL_XCPTS) || defined(VBOX_WITH_NESTED_HWVIRT_SVM) 7547 7547 /** 7548 7548 * \#VMEXIT handler for generic exceptions. Conditional \#VMEXIT. … … 7588 7588 #endif 7589 7589 7590 #ifdef VBOX_WITH_NESTED_HWVIRT 7590 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM 7591 7591 /** 7592 7592 * \#VMEXIT handler for #PF occuring while in nested-guest execution … … 7824 7824 } 7825 7825 7826 #endif /* VBOX_WITH_NESTED_HWVIRT */7826 #endif /* VBOX_WITH_NESTED_HWVIRT_SVM */ 7827 7827 7828 7828
Note:
See TracChangeset
for help on using the changeset viewer.