Changeset 79874 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 19, 2019 9:15:09 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp
r79715 r79874 1325 1325 */ 1326 1326 pVCpu->hm.s.vmx.fMergedNstGstCtls = false; 1327 1328 /* 1329 * Flush the TLB before entering the outer guest execution (mainly required since the 1330 * APIC-access guest-physical address would have changed and probably more things in 1331 * the future). 1332 */ 1333 pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = true; 1327 1334 } 1328 1335 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r79872 r79874 3034 3034 HMVMX_SET_TAGGED_TLB_FLUSHED(); 3035 3035 } 3036 else if (pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb) 3037 { 3038 /* 3039 * The nested-guest specifies its own guest-physical address to use as the APIC-access 3040 * address which requires flushing the TLB of EPT cached structures. 3041 * 3042 * See Intel spec. 28.3.3.4 "Guidelines for Use of the INVEPT Instruction". 3043 */ 3044 hmR0VmxFlushEpt(pVCpu, pVmcsInfo, pVM->hm.s.vmx.enmTlbFlushEpt); 3045 pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = false; 3046 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbNstGst); 3047 HMVMX_SET_TAGGED_TLB_FLUSHED(); 3048 } 3049 3036 3050 3037 3051 pVCpu->hm.s.fForceTLBFlush = false; … … 3091 3105 } 3092 3106 3107 /* Check for TLB flushes while switching to/from a nested-guest. */ 3108 if (pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb) 3109 { 3110 pVCpu->hm.s.fForceTLBFlush = true; 3111 pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = false; 3112 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbNstGst); 3113 } 3114 3093 3115 pVCpu->hm.s.idLastCpu = pHostCpu->idCpu; 3094 3116 pVCpu->hm.s.cTlbFlushes = pHostCpu->cTlbFlushes; … … 3142 3164 pVCpu->hm.s.fForceTLBFlush = true; 3143 3165 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlb); 3166 } 3167 3168 /* Check for TLB flushes while switching to/from a nested-guest. */ 3169 if (pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb) 3170 { 3171 pVCpu->hm.s.fForceTLBFlush = true; 3172 pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = false; 3173 STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbNstGst); 3144 3174 } 3145 3175 … … 10959 10989 pVmcsInfoNstGst->u32XcptPFMatch = u32XcptPFMatch; 10960 10990 pVmcsInfoNstGst->HCPhysVirtApic = HCPhysVirtApic; 10991 10992 /* 10993 * We need to flush the TLB if we are switching the API-access page address. 10994 * See Intel spec. 28.3.3.4 "Guidelines for Use of the INVEPT Instruction". 10995 */ 10996 if (u32ProcCtls2 & VMX_PROC_CTLS2_VIRT_APIC_ACCESS) 10997 pVCpu->hm.s.vmx.fSwitchedNstGstFlushTlb = true; 10961 10998 10962 10999 /* -
trunk/src/VBox/VMM/include/HMInternal.h
r79873 r79874 994 994 /** Whether the nested-guest VMCS has been copied to the shadow VMCS. */ 995 995 bool fCopiedNstGstToShadowVmcs; 996 /** Whether flushing the TLB is required due to switching to/from the 997 * nested-geust. */ 998 bool fSwitchedNstGstFlushTlb; 996 999 /** Alignment. */ 997 bool afAlignment0[ 5];1000 bool afAlignment0[4]; 998 1001 /** Cached guest APIC-base MSR for identifying when to map the APIC-access page. */ 999 1002 uint64_t u64GstMsrApicBase;
Note:
See TracChangeset
for help on using the changeset viewer.