VirtualBox

Changeset 71755 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Apr 9, 2018 8:10:23 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121857
Message:

VMM: Nested Hw.virt: Fix overriding SVM nested-guest PAT MSR while executing with nested-guest w/ shadow paging.
Also fixes loading, validating and restoring the PAT MSR when nested-paging is used by the nested-hypervisor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r71697 r71755  
    10011001        /*
    10021002         * Setup the PAT MSR (applicable for Nested Paging only).
    1003          * The default value should be 0x0007040600070406ULL, but we want to treat all guest memory as WB,
    1004          * so choose type 6 for all PAT slots.
     1003         *
     1004         * While guests can modify and see the modified values throug the shadow values,
     1005         * we shall not honor any guest modifications of this MSR to ensure caching is always
     1006         * enabled similar to how we always run with CR0.CD and NW bits cleared.
    10051007         */
    1006         pVmcb->guest.u64GPAT = UINT64_C(0x0006060606060606);
     1008        pVmcb->guest.u64PAT = MSR_IA32_CR_PAT_INIT_VAL;
    10071009
    10081010        /* Setup Nested Paging. This doesn't change throughout the execution time of the VM. */
     
    17541756    pVmcb->guest.u64SFMASK       = pCtx->msrSFMASK;
    17551757    pVmcb->guest.u64KernelGSBase = pCtx->msrKERNELGSBASE;
     1758
     1759    /* We don't honor guest modifications to its PAT MSR (similar to ignoring CR0.CD, NW bits). */
    17561760}
    17571761
     
    24172421        pVmcbNstGstCache->u64CR4            = pVmcbNstGstState->u64CR4;
    24182422        pVmcbNstGstCache->u64EFER           = pVmcbNstGstState->u64EFER;
     2423        pVmcbNstGstCache->u64PAT            = pVmcbNstGstState->u64PAT;
    24192424        pVmcbNstGstCache->u64DBGCTL         = pVmcbNstGstState->u64DBGCTL;
    24202425        pVmcbNstGstCache->u64IOPMPhysAddr   = pVmcbNstGstCtrl->u64IOPMPhysAddr;
     
    24702475        pVmcbNstGstCtrl->LbrVirt.n.u1LbrVirt = pVmcb->ctrl.LbrVirt.n.u1LbrVirt;
    24712476        pVmcbNstGst->guest.u64DBGCTL = pVmcb->guest.u64DBGCTL;
     2477
     2478        /* Override nested-guest PAT MSR, see @bugref{7243#c109}. */
     2479        pVmcbNstGst->guest.u64PAT = MSR_IA32_CR_PAT_INIT_VAL;
    24722480    }
    24732481    else
     
    39193927        Log4(("guest.u64SFMASK                   %#RX64\n",   pVmcb->guest.u64SFMASK));
    39203928        Log4(("guest.u64KernelGSBase             %#RX64\n",   pVmcb->guest.u64KernelGSBase));
    3921         Log4(("guest.u64GPAT                     %#RX64\n",   pVmcb->guest.u64GPAT));
     3929        Log4(("guest.u64PAT                      %#RX64\n",   pVmcb->guest.u64PAT));
    39223930        Log4(("guest.u64DBGCTL                   %#RX64\n",   pVmcb->guest.u64DBGCTL));
    39233931        Log4(("guest.u64BR_FROM                  %#RX64\n",   pVmcb->guest.u64BR_FROM));
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