VirtualBox

Changeset 79345 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jun 26, 2019 9:09:46 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131577
Message:

VMM/HM: Nested VMX: bugref:9180 Implemented VMCS shadowing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/HMVMXAll.cpp

    r79166 r79345  
    12321232 *
    12331233 * @param   pVCpu   The cross context virtual CPU structure.
    1234  * @param   pCtx    Pointer to the guest-CPU context.
    12351234 *
    12361235 * @remarks Can be called from ring-0 as well as ring-3.
    12371236 */
    1238 VMM_INT_DECL(void) HMNotifyVmxNstGstVmexit(PVMCPU pVCpu, PCPUMCTX pCtx)
    1239 {
    1240     NOREF(pCtx);
    1241 
     1237VMM_INT_DECL(void) HMNotifyVmxNstGstVmexit(PVMCPU pVCpu)
     1238{
    12421239    /*
    12431240     * Transitions to ring-3 flag a full CPU-state change except if we transition to ring-3
     
    12491246     * for the nested-guest from ring-3.
    12501247     *
    1251      * Flag reloading of just the guest-CPU state is -not- sufficient since HM also needs
    1252      * to reload related state with VM-entry/VM-exit controls and so on. Flag reloading
    1253      * the entire state.
     1248     * Signalling reload of just the guest-CPU state that changed with the VM-exit is -not-
     1249     * sufficient since HM also needs to reload state related to VM-entry/VM-exit controls
     1250     * etc. So signal reloading of the entire state. It does not seem worth making this any
     1251     * more fine grained at the moment.
    12541252     */
    12551253    CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_ALL);
     
    12581256    /*
    12591257     * Make sure we need to merge the guest VMCS controls with the nested-guest
    1260      * VMCS controls on the next nested-guest VM entry.
     1258     * VMCS controls on the next nested-guest VM-entry.
    12611259     */
    12621260    pVCpu->hm.s.vmx.fMergedNstGstCtls = false;
    12631261}
     1262
     1263
     1264/**
     1265 * Notification callback for when the guest hypervisor's current VMCS is loaded or
     1266 * changed outside VMX R0 code (e.g. in IEM).
     1267 *
     1268 * This need -not- be called for modifications to the guest hypervisor's current
     1269 * VMCS when the guest is in VMX non-root mode as VMCS shadowing is not applicable
     1270 * there.
     1271 *
     1272 * @param   pVCpu   The cross context virtual CPU structure.
     1273 *
     1274 * @remarks Can be called from ring-0 as well as ring-3.
     1275 */
     1276VMM_INT_DECL(void) HMNotifyVmxNstGstCurrentVmcsChanged(PVMCPU pVCpu)
     1277{
     1278    CPUM_ASSERT_NOT_EXTRN(pVCpu, CPUMCTX_EXTRN_HWVIRT);
     1279    ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, CPUMCTX_EXTRN_HWVIRT);
     1280
     1281    /*
     1282     * Make sure we need to copy the guest hypervisor's current VMCS into the shadow VMCS
     1283     * on the next guest VM-entry.
     1284     */
     1285    pVCpu->hm.s.vmx.fCopiedNstGstToShadowVmcs = false;
     1286}
     1287
    12641288# endif /* VBOX_WITH_NESTED_HWVIRT_VMX */
    12651289#endif /* IN_RC */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette