VirtualBox

Changeset 79073 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jun 11, 2019 5:26:37 AM (6 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:9180 With HM execution of nested-guests, we merge the guest/host mask of the guest and nested-guest. Hence, while constructing the read-shadow, we must use the merged mask. Pass the merged mask as a parameter to CPUMGetGuestVmxMasked[Cr0|Cr4] as otherwise it will continue to use the original mask from the nested-guest VMCS instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r78986 r79073  
    22142214 *
    22152215 * @returns The nested-guest CR0.
    2216  * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
    2217  * @param   pCtx        Pointer to the context.
    2218  */
    2219 DECLINLINE(uint64_t) CPUMGetGuestVmxMaskedCr0(PCVMCPU pVCpu, PCCPUMCTX pCtx)
     2216 * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
     2217 * @param   pCtx            Pointer to the context.
     2218 * @param   fGstHostMask    The CR0 guest/host mask to use.
     2219 */
     2220DECLINLINE(uint64_t) CPUMGetGuestVmxMaskedCr0(PCVMCPU pVCpu, PCCPUMCTX pCtx, uint64_t fGstHostMask)
    22202221{
    22212222    /*
     
    22312232    Assert(pVmcs);
    22322233    uint64_t const uGstCr0      = pCtx->cr0;
    2233     uint64_t const fGstHostMask = pVmcs->u64Cr0Mask.u;
    22342234    uint64_t const fReadShadow  = pVmcs->u64Cr0ReadShadow.u;
    22352235    return (fReadShadow & fGstHostMask) | (uGstCr0 & ~fGstHostMask);
     
    22402240 *
    22412241 * @returns The nested-guest CR4.
    2242  * @param   pVCpu       The cross context virtual CPU structure of the calling EMT.
    2243  * @param   pCtx        Pointer to the context.
    2244  */
    2245 DECLINLINE(uint64_t) CPUMGetGuestVmxMaskedCr4(PCVMCPU pVCpu, PCCPUMCTX pCtx)
     2242 * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
     2243 * @param   pCtx            Pointer to the context.
     2244 * @param   fGstHostMask    The CR4 guest/host mask to use.
     2245 */
     2246DECLINLINE(uint64_t) CPUMGetGuestVmxMaskedCr4(PCVMCPU pVCpu, PCCPUMCTX pCtx, uint64_t fGstHostMask)
    22462247{
    22472248    /*
     
    22572258    Assert(pVmcs);
    22582259    uint64_t const uGstCr4      = pCtx->cr4;
    2259     uint64_t const fGstHostMask = pVmcs->u64Cr4Mask.u;
    22602260    uint64_t const fReadShadow  = pVmcs->u64Cr4ReadShadow.u;
    22612261    return (fReadShadow & fGstHostMask) | (uGstCr4 & ~fGstHostMask);
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