VirtualBox

Changeset 49442 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 11, 2013 9:52:32 PM (11 years ago)
Author:
vboxsync
Message:

DevAPIC: Always set the APIC CPUID feature bits when the device is constructed, regardless of the CPU vendor. I.e. just like apicR3Reset always did.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r49437 r49442  
    284284    /* Physical APIC id - not visible to user, constant */
    285285    PhysApicId              phys_id;
    286     /** @todo: is it logical or physical? Not really used anyway now. */
     286    /** @todo is it logical or physical? Not really used anyway now. */
    287287    PhysApicId              arb_id;
    288288    uint32_t                spurious_vec;
     
    493493            return MSR_IA32_APICBASE_ENABLE;
    494494        case PDMAPICVERSION_X2APIC:
    495             return MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_X2ENABLE ;
     495            return MSR_IA32_APICBASE_ENABLE | MSR_IA32_APICBASE_X2ENABLE;
    496496        default:
    497497            AssertMsgFailed(("Unsupported APIC version %d\n", pDev->enmVersion));
     
    588588    Log(("apicSetBase: %016RX64\n", val));
    589589
    590     /** @todo: do we need to lock here ? */
     590    /** @todo do we need to lock here ? */
    591591    /* APIC_LOCK_VOID(pDev, VERR_INTERNAL_ERROR); */
    592592    /** @todo If this change is valid immediately, then we should change the MMIO registration! */
     
    610610            }
    611611            case PDMAPICVERSION_APIC:
    612                 /** @todo: map MMIO ranges, if needed */
     612                /** @todo map MMIO ranges, if needed */
    613613                break;
    614614            case PDMAPICVERSION_X2APIC:
    615                 /** @todo: unmap MMIO ranges of this APIC, according to the spec */
     615                /** @todo unmap MMIO ranges of this APIC, according to the spec.  This is how
     616                 *       real hw works! (Remember the problem disabling NMI watchdog timers in
     617                 *       the world switchers when host used x2apic?)! */
    616618                break;
    617619            default:
     
    18531855    Assert(cb == 4);
    18541856
    1855     /** @todo: add LAPIC range validity checks (multiple LAPICs can theoretically have
    1856      *        different physical addresses, see @bugref{3092}) */
     1857    /** @todo add LAPIC range validity checks (multiple LAPICs can theoretically
     1858     *        have different physical addresses, see @bugref{3092}) */
    18571859
    18581860    STAM_COUNTER_INC(&CTXSUFF(pDev->StatMMIOWrite));
     
    20482050    apicR3LiveExec(pDevIns, pSSM, SSM_PASS_FINAL);
    20492051
    2050     /* save all APICs data */ /** @todo: is it correct? */
     2052    /* save all APICs data */ /** @todo is it correct? */
    20512053    APIC_FOREACH_BEGIN(pDev);
    20522054        apic_save(pSSM, pCurApic);
     
    20902092        return VINF_SUCCESS;
    20912093
    2092     /* load all APICs data */ /** @todo: is it correct? */
     2094    /* load all APICs data */ /** @todo is it correct? */
    20932095    APIC_LOCK(pDev, VERR_INTERNAL_ERROR_3);
    20942096
     
    21342136        apicCpuClearInterrupt(pDev, pApic);
    21352137    }
    2136     /** @todo r=bird: Why is this done everytime, while the constructor first
    2137      *        checks the CPUID?  Who is right? */
     2138
     2139    LogRel(("DevAPIC: Re-activating Local APIC\n"));
    21382140    pDev->pApicHlpR3->pfnChangeFeature(pDev->pDevInsR3, pDev->enmVersion);
    21392141
     
    22312233    pDev->cCpus      = cCpus;
    22322234    pDev->fIoApic    = fIoApic;
    2233     /* Use PDMAPICVERSION_X2APIC to activate x2APIC mode */
     2235    /** @todo Finish X2APIC implementation.  Must, among other things, set
     2236     *        PDMAPICVERSION_X2APIC here when X2APIC is configured. */
    22342237    pDev->enmVersion = PDMAPICVERSION_APIC;
    22352238
     
    23232326     * The CPUID feature bit.
    23242327     */
    2325     /** @todo r=bird: See remark in the apicR3Reset. */
    2326     uint32_t u32Eax, u32Ebx, u32Ecx, u32Edx;
    2327     PDMDevHlpGetCpuId(pDevIns, 0, &u32Eax, &u32Ebx, &u32Ecx, &u32Edx);
    2328     if (u32Eax >= 1)
    2329     {
    2330         if (   fIoApic                       /* If IOAPIC is enabled, enable Local APIC in any case */
    2331             || (   u32Ebx == X86_CPUID_VENDOR_INTEL_EBX
    2332                 && u32Ecx == X86_CPUID_VENDOR_INTEL_ECX
    2333                 && u32Edx == X86_CPUID_VENDOR_INTEL_EDX /* GenuineIntel */)
    2334             || (   u32Ebx == X86_CPUID_VENDOR_AMD_EBX
    2335                 && u32Ecx == X86_CPUID_VENDOR_AMD_ECX
    2336                 && u32Edx == X86_CPUID_VENDOR_AMD_EDX   /* AuthenticAMD */))
    2337         {
    2338             LogRel(("Activating Local APIC\n"));
    2339             pDev->pApicHlpR3->pfnChangeFeature(pDevIns, pDev->enmVersion);
    2340         }
    2341     }
     2328    LogRel(("DevAPIC: Activating Local APIC\n"));
     2329    pDev->pApicHlpR3->pfnChangeFeature(pDevIns, pDev->enmVersion);
    23422330
    23432331    /*
    23442332     * Register the MMIO range.
    23452333     */
    2346     /** @todo: shall reregister, if base changes. */
     2334    /** @todo shall reregister, if base changes. */
    23472335    uint32_t ApicBase = pDev->paLapicsR3[0].apicbase & ~0xfff;
    23482336    rc = PDMDevHlpMMIORegister(pDevIns, ApicBase, 0x1000, pDev,
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