VirtualBox

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


Ignore:
Timestamp:
Feb 2, 2021 4:33:51 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
142567
Message:

VMM/HMVMX: Use g_HmMsrs instead of pVM->hm.s.vmx.Msrs in ring-0, part 1. bugref:9217

File:
1 edited

Legend:

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

    r87515 r87541  
    766766    if (pVM->hm.s.vmx.fEnabled)
    767767    {
    768         uint32_t uCr0Mask;
    769 
    770768        /* If bit N is set in cr0_fixed0, then it must be set in the guest's cr0. */
    771         uCr0Mask = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr0Fixed0;
     769        uint32_t uCr0Mask = (uint32_t)CTX_EXPR(pVM->hm.s.vmx.Msrs.u64Cr0Fixed0, g_HmMsrs.u.vmx.u64Cr0Fixed0, RT_NOTHING);
    772770
    773771        /* We ignore the NE bit here on purpose; see HMR0.cpp for details. */
     
    788786
    789787        /* If bit N is cleared in cr0_fixed1, then it must be zero in the guest's cr0. */
    790         uCr0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr0Fixed1;
     788        uCr0Mask = (uint32_t)~CTX_EXPR(pVM->hm.s.vmx.Msrs.u64Cr0Fixed1, g_HmMsrs.u.vmx.u64Cr0Fixed1, RT_NOTHING);
    791789        if ((pCtx->cr0 & uCr0Mask) != 0)
    792790            return false;
    793791
    794792        /* If bit N is set in cr4_fixed0, then it must be set in the guest's cr4. */
    795         uCr0Mask  = (uint32_t)pVM->hm.s.vmx.Msrs.u64Cr4Fixed0;
     793        uCr0Mask  = (uint32_t)CTX_EXPR(pVM->hm.s.vmx.Msrs.u64Cr4Fixed0, g_HmMsrs.u.vmx.u64Cr4Fixed0, RT_NOTHING);
    796794        uCr0Mask &= ~X86_CR4_VMXE;
    797795        if ((pCtx->cr4 & uCr0Mask) != uCr0Mask)
     
    799797
    800798        /* If bit N is cleared in cr4_fixed1, then it must be zero in the guest's cr4. */
    801         uCr0Mask = (uint32_t)~pVM->hm.s.vmx.Msrs.u64Cr4Fixed1;
     799        uCr0Mask = (uint32_t)~CTX_EXPR(pVM->hm.s.vmx.Msrs.u64Cr4Fixed1, g_HmMsrs.u.vmx.u64Cr4Fixed1, RT_NOTHING);
    802800        if ((pCtx->cr4 & uCr0Mask) != 0)
    803801            return false;
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