VirtualBox

Changeset 54760 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 13, 2015 8:53:02 PM (10 years ago)
Author:
vboxsync
Message:

CPUMGetGuestCpuId: Fixed APIC ID assertions to read the pLeaf values instead of the return values, as the caller may be passing the same pointer for several of them (i.e. ignoring some values).

File:
1 edited

Legend:

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

    r54737 r54760  
    12701270                                uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
    12711271{
    1272     bool           fExactSubLeafHit;
    1273     PVM            pVM   = pVCpu->CTX_SUFF(pVM);
    1274     PCPUMCPUIDLEAF pLeaf = cpumCpuIdGetLeafEx(pVM, uLeaf, uSubLeaf, &fExactSubLeafHit);
     1272    bool            fExactSubLeafHit;
     1273    PVM             pVM   = pVCpu->CTX_SUFF(pVM);
     1274    PCCPUMCPUIDLEAF pLeaf = cpumCpuIdGetLeafEx(pVM, uLeaf, uSubLeaf, &fExactSubLeafHit);
    12751275    if (pLeaf)
    12761276    {
     1277        AssertMsg(pLeaf->uLeaf == uLeaf, ("%#x\n", pLeaf->uLeaf, uLeaf));
    12771278        if (fExactSubLeafHit)
    12781279        {
     
    12911292                    /* Bits 31-24: Initial APIC ID */
    12921293                    Assert(pVCpu->idCpu <= 255);
    1293                     Assert((*pEbx >> 24) == 0); /* raw-mode assumption */
    1294                     *pEbx = (*pEbx & UINT32_C(0x00ffffff)) | (pVCpu->idCpu << 24);
     1294                    AssertMsg((pLeaf->uEbx >> 24) == 0, ("%#x\n", pLeaf->uEbx)); /* raw-mode assumption */
     1295                    *pEbx = (pLeaf->uEbx & UINT32_C(0x00ffffff)) | (pVCpu->idCpu << 24);
    12951296                }
    12961297                else if (uLeaf == 0xb)
    12971298                {
    12981299                    /* EDX: Initial extended APIC ID. */
    1299                     Assert(*pEdx == 0); /* raw-mode assumption */
     1300                    AssertMsg(pLeaf->uEdx == 0, ("%#x\n", pLeaf->uEdx)); /* raw-mode assumption */
    13001301                    *pEdx = pVCpu->idCpu;
    13011302                }
     
    13031304                {
    13041305                    /* EAX: Initial extended APIC ID. */
    1305                     Assert(*pEax == 0); /* raw-mode assumption */
     1306                    AssertMsg(pLeaf->uEax == 0, ("%#x\n", pLeaf->uEax)); /* raw-mode assumption */
    13061307                    *pEax = pVCpu->idCpu;
    13071308                }
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