VirtualBox

Changeset 2010 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 10, 2007 2:40:25 PM (18 years ago)
Author:
vboxsync
Message:

Check for monitor/mwait support in cpuid before emulating them.

File:
1 edited

Legend:

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

    r2005 r2010  
    16031603static int emInterpretMonitor(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
    16041604{
     1605    uint32_t u32Dummy, u32ExtFeatures, cpl;
     1606
    16051607    if (pRegFrame->ecx != 0)
    16061608        return VERR_EM_INTERPRETER; /* illegal value. */
    16071609
    16081610    /* Get the current privilege level. */
    1609     uint32_t cpl = CPUMGetGuestCPL(pVM, pRegFrame);
     1611    cpl = CPUMGetGuestCPL(pVM, pRegFrame);
    16101612    if (cpl != 0)
    16111613        return VERR_EM_INTERPRETER; /* supervisor only */
    16121614
     1615    CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
     1616    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
     1617        return VERR_EM_INTERPRETER; /* not supported */
     1618
    16131619    return VINF_SUCCESS;
    16141620}
     
    16201626static int emInterpretMWait(PVM pVM, PDISCPUSTATE pCpu, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, uint32_t *pcbSize)
    16211627{
     1628    uint32_t u32Dummy, u32ExtFeatures, cpl;
     1629
    16221630    if (pRegFrame->ecx != 0)
    16231631        return VERR_EM_INTERPRETER; /* illegal value. */
    16241632
    16251633    /* Get the current privilege level. */
    1626     uint32_t cpl = CPUMGetGuestCPL(pVM, pRegFrame);
     1634    cpl = CPUMGetGuestCPL(pVM, pRegFrame);
    16271635    if (cpl != 0)
    16281636        return VERR_EM_INTERPRETER; /* supervisor only */
     1637
     1638    CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &u32ExtFeatures, &u32Dummy);
     1639    if (!(u32ExtFeatures & X86_CPUID_FEATURE_ECX_MONITOR))
     1640        return VERR_EM_INTERPRETER; /* not supported */
    16291641
    16301642    /** @todo not completely correct */
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