VirtualBox

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


Ignore:
Timestamp:
Feb 1, 2021 9:01:16 PM (4 years ago)
Author:
vboxsync
Message:

VMM/HM: Make a R0 copy of HM::fAllow64BitGuests on setup (for VT-x). bugref:9217

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r87515 r87518  
    990990
    991991    /*
    992      * Validate some parameters.
     992     * Validate and copy over some parameters.
    993993     */
    994994    AssertReturn(pVM->hm.s.svm.fSupported, VERR_INCOMPATIBLE_CONFIG);
     
    998998                 VERR_INCOMPATIBLE_CONFIG);
    999999    pVM->hmr0.s.fNestedPaging = fNestedPaging;
     1000    pVM->hmr0.s.fAllow64BitGuests = pVM->hm.s.fAllow64BitGuestsCfg;
    10001001
    10011002    /*
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r87515 r87518  
    25042504    {
    25052505        Assert(!(pVCpu->hmr0.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST));  /* Guest MSRs better not be loaded now. */
    2506         if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     2506        if (pVCpu->CTX_SUFF(pVM)->hmr0.s.fAllow64BitGuests)
    25072507        {
    25082508            pVCpu->hmr0.s.vmx.u64HostMsrLStar        = ASMRdMsr(MSR_K8_LSTAR);
     
    25262526static bool hmR0VmxIsLazyGuestMsr(PCVMCPUCC pVCpu, uint32_t idMsr)
    25272527{
    2528     if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     2528    if (pVCpu->CTX_SUFF(pVM)->hmr0.s.fAllow64BitGuests)
    25292529    {
    25302530        switch (idMsr)
     
    25592559
    25602560    Assert(pVCpu->hmr0.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST);
    2561     if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     2561    if (pVCpu->CTX_SUFF(pVM)->hmr0.s.fAllow64BitGuests)
    25622562    {
    25632563        /*
     
    26152615    {
    26162616        Assert(pVCpu->hmr0.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_SAVED_HOST);
    2617         if (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests)
     2617        if (pVCpu->CTX_SUFF(pVM)->hmr0.s.fAllow64BitGuests)
    26182618        {
    26192619            ASMWrMsr(MSR_K8_LSTAR,          pVCpu->hmr0.s.vmx.u64HostMsrLStar);
     
    37743774     * required for 64-bit guests.
    37753775     */
    3776     if (pVM->hm.s.fAllow64BitGuests)
     3776    if (pVM->hmr0.s.fAllow64BitGuests)
    37773777    {
    37783778        hmR0VmxSetMsrPermission(pVCpu, pVmcsInfo, false, MSR_K8_LSTAR,          VMXMSRPM_ALLOW_RD_WR);
     
    39903990        /* Some 32-bit CPUs do not support CR8 load/store exiting as MOV CR8 is
    39913991           invalid on 32-bit Intel CPUs. Set this control only for 64-bit guests. */
    3992         if (pVM->hm.s.fAllow64BitGuests)
    3993         {
     3992        if (pVM->hmr0.s.fAllow64BitGuests)
    39943993            fVal |= VMX_PROC_CTLS_CR8_STORE_EXIT             /* CR8 reads cause a VM-exit. */
    39953994                 |  VMX_PROC_CTLS_CR8_LOAD_EXIT;             /* CR8 writes cause a VM-exit. */
    3996         }
    39973995    }
    39983996
     
    45384536                 VERR_INCOMPATIBLE_CONFIG);
    45394537    pVM->hmr0.s.fNestedPaging = fNestedPaging;
     4538    pVM->hmr0.s.fAllow64BitGuests = pVM->hm.s.fAllow64BitGuestsCfg;
    45404539
    45414540    /* Initialize these always, see hmR3InitFinalizeR0().*/
     
    77547753            if (fWhat & CPUMCTX_EXTRN_KERNEL_GS_BASE)
    77557754            {
    7756                 if (   pVM->hm.s.fAllow64BitGuests
     7755                if (   pVM->hmr0.s.fAllow64BitGuests
    77577756                    && (pVCpu->hmr0.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST))
    77587757                    pCtx->msrKERNELGSBASE = ASMRdMsr(MSR_K8_KERNEL_GS_BASE);
     
    77617760            if (fWhat & CPUMCTX_EXTRN_SYSCALL_MSRS)
    77627761            {
    7763                 if (   pVM->hm.s.fAllow64BitGuests
     7762                if (   pVM->hmr0.s.fAllow64BitGuests
    77647763                    && (pVCpu->hmr0.s.vmx.fLazyMsrs & VMX_LAZY_MSRS_LOADED_GUEST))
    77657764                {
     
    1059610595         * be taken care of by EPT/shadow paging.
    1059710596         */
    10598         if (pVM->hm.s.fAllow64BitGuests)
    10599         {
     10597        if (pVM->hmr0.s.fAllow64BitGuests)
    1060010598            u32ProcCtls |= VMX_PROC_CTLS_CR8_STORE_EXIT
    1060110599                        |  VMX_PROC_CTLS_CR8_LOAD_EXIT;
    10602         }
    1060310600    }
    1060410601
Note: See TracChangeset for help on using the changeset viewer.

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