VirtualBox

Changeset 99261 in vbox for trunk/src


Ignore:
Timestamp:
Apr 3, 2023 12:20:40 PM (22 months ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:10318 Better fix for r156590.

File:
1 edited

Legend:

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

    r99220 r99261  
    14941494
    14951495    /* Blocking-by-STI or blocking-by-MovSS. */
    1496     if (!CPUMIsInInterruptShadowWithUpdate(&pVCpu->cpum.GstCtx))
     1496    uint32_t fInhibitShw;
     1497    if (!CPUMIsInInterruptShadowWithUpdateEx(&pVCpu->cpum.GstCtx, &fInhibitShw))
    14971498    { /* probable */}
    14981499    else
    14991500    {
    15001501        if (pVCpu->cpum.GstCtx.rip == pVCpu->cpum.GstCtx.uRipInhibitInt)
    1501             pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_MOVSS;
    1502 
    1503         /* Clear inhibition unconditionally since we've ensured it isn't set prior to executing VMLAUNCH/VMRESUME. */
    1504         CPUMClearInterruptShadow(&pVCpu->cpum.GstCtx);
     1502        {
     1503            /*
     1504             * We must take care to ensure only one of these bits are set.
     1505             * Our emulation can have both set perhaps because AMD doesn't distinguish
     1506             * between the two? Hence the 'else' with blocking-by-MovSS taking priority
     1507             * since it blocks more. Nested Ubuntu running inside a Hyper-V enabled
     1508             * Windows Server 2008 R2 guest runs into this issue.
     1509             *
     1510             * See Intel spec. 26.3.1.5 "Checks on Guest Non-Register State".
     1511             */
     1512            if (fInhibitShw & CPUMCTX_INHIBIT_SHADOW_SS)
     1513                pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_MOVSS;
     1514            else
     1515            {
     1516                Assert(fInhibitShw & CPUMCTX_INHIBIT_SHADOW_STI);
     1517                pVmcs->u32GuestIntrState |= VMX_VMCS_GUEST_INT_STATE_BLOCK_STI;
     1518            }
     1519        }
    15051520    }
    15061521    /* Nothing to do for SMI/enclave. We don't support enclaves or SMM yet. */
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