VirtualBox

Changeset 74455 in vbox for trunk


Ignore:
Timestamp:
Sep 25, 2018 11:18:05 AM (6 years ago)
Author:
vboxsync
Message:

VMX: Also enforce RM compatible attributes before using real-on-V86 execution.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

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

    r74429 r74455  
    658658                /*
    659659                 * In V86 mode (VT-x or not), the CPU enforces real-mode compatible selector
    660                  * bases and limits, i.e. limit must be 64K and base must be selector * 16.
     660                 * bases, limits, and attributes, i.e. limit must be 64K, base must be selector * 16,
     661                 * and attrributes must be 0x9b for code and 0x93 for code segments.
    661662                 * If this is not true, we cannot execute real mode as V86 and have to fall
    662663                 * back to emulation.
     
    680681                {
    681682                    STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadRmSelLimit);
     683                    return false;
     684                }
     685                if (   (pCtx->cs.Attr.u != 0x9b)
     686                    || (pCtx->ds.Attr.u != 0x93)
     687                    || (pCtx->es.Attr.u != 0x93)
     688                    || (pCtx->ss.Attr.u != 0x93)
     689                    || (pCtx->fs.Attr.u != 0x93)
     690                    || (pCtx->gs.Attr.u != 0x93))
     691                {
     692                    STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadRmSelAttr);
    682693                    return false;
    683694                }
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r74061 r74455  
    10491049        HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRmSelBase,   "/HM/CPU%d/VMXCheck/RMSelBase", "Could not use VMX due to unsuitable real-mode selector base.");
    10501050        HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRmSelLimit,  "/HM/CPU%d/VMXCheck/RMSelLimit", "Could not use VMX due to unsuitable real-mode selector limit.");
     1051        HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadRmSelAttr,   "/HM/CPU%d/VMXCheck/RMSelAttrs", "Could not use VMX due to unsuitable real-mode selector limit.");
    10511052        HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckRmOk,           "/HM/CPU%d/VMXCheck/VMX_RM", "VMX execution in real (V86) mode OK.");
    10521053        HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadSel,         "/HM/CPU%d/VMXCheck/Selector", "Could not use VMX due to unsuitable selector.");
  • trunk/src/VBox/VMM/include/HMInternal.h

    r73606 r74455  
    10391039    STAMCOUNTER             StatVmxCheckBadRmSelBase;
    10401040    STAMCOUNTER             StatVmxCheckBadRmSelLimit;
     1041    STAMCOUNTER             StatVmxCheckBadRmSelAttr;
    10411042    STAMCOUNTER             StatVmxCheckRmOk;
    10421043    STAMCOUNTER             StatVmxCheckBadSel;
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