VirtualBox

Changeset 60307 in vbox for trunk/src/VBox/VMM/VMMRC


Ignore:
Timestamp:
Apr 4, 2016 3:23:11 PM (9 years ago)
Author:
vboxsync
Message:

VMM: APIC rewrite. Initial commit, work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRC/PDMRCDevice.cpp

    r58126 r60307  
    409409    PDMDEV_ASSERT_DEVINS(pDevIns);
    410410    PVM pVM = pDevIns->Internal.s.pVMRC;
     411    PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
    411412
    412413    if (pVM->pdm.s.Apic.pfnLocalInterruptRC)
     
    415416                 pDevIns, pDevIns->iInstance));
    416417        /* Raise the LAPIC's LINT0 line instead of signaling the CPU directly. */
    417         pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, 0, 1);
     418        /** @todo 'rcRZ' propagation to pfnLocalInterrupt from caller. */
     419        pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, pVCpu, 0 /* u8Pin */, 1 /* u8Level*/,
     420                                            VINF_SUCCESS /*rcRZ*/);
    418421        return;
    419422    }
    420 
    421     PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
    422423
    423424    LogFlow(("pdmRCPicHlp_SetInterruptFF: caller=%p/%d: VMMCPU_FF_INTERRUPT_PIC %d -> 1\n",
     
    433434    PDMDEV_ASSERT_DEVINS(pDevIns);
    434435    PVM pVM = pDevIns->Internal.s.CTX_SUFF(pVM);
     436    PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
    435437
    436438    if (pVM->pdm.s.Apic.pfnLocalInterruptRC)
     
    440442                 pDevIns, pDevIns->iInstance));
    441443        /* Lower the LAPIC's LINT0 line instead of signaling the CPU directly. */
    442         pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, 0, 0);
     444        /** @todo 'rcRZ' propagation to pfnLocalInterrupt from caller. */
     445        pVM->pdm.s.Apic.pfnLocalInterruptRC(pVM->pdm.s.Apic.pDevInsRC, pVCpu, 0 /* u8Pin */, 0 /* u8Level */,
     446                                            VINF_SUCCESS /* rcRZ */);
    443447        return;
    444448    }
    445 
    446     PVMCPU pVCpu = &pVM->aCpus[0];  /* for PIC we always deliver to CPU 0, MP use APIC */
    447449
    448450    LogFlow(("pdmRCPicHlp_ClearInterruptFF: caller=%p/%d: VMCPU_FF_INTERRUPT_PIC %d -> 0\n",
     
    574576
    575577/** @interface_method_impl{PDMAPICHLPRC,pfnChangeFeature} */
    576 static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICVERSION enmVersion)
    577 {
    578     PDMDEV_ASSERT_DEVINS(pDevIns);
    579     LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: version=%d\n", pDevIns, pDevIns->iInstance, (int)enmVersion));
    580     switch (enmVersion)
    581     {
    582         case PDMAPICVERSION_NONE:
     578static DECLCALLBACK(void) pdmRCApicHlp_ChangeFeature(PPDMDEVINS pDevIns, PDMAPICMODE enmMode)
     579{
     580    PDMDEV_ASSERT_DEVINS(pDevIns);
     581    LogFlow(("pdmRCApicHlp_ChangeFeature: caller=%p/%d: mode=%d\n", pDevIns, pDevIns->iInstance, (int)enmMode));
     582    switch (enmMode)
     583    {
     584        case PDMAPICMODE_NONE:
    583585            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    584586            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    585587            break;
    586         case PDMAPICVERSION_APIC:
     588        case PDMAPICMODE_APIC:
    587589            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    588590            CPUMClearGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    589591            break;
    590         case PDMAPICVERSION_X2APIC:
     592        case PDMAPICMODE_X2APIC:
    591593            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_X2APIC);
    592594            CPUMSetGuestCpuIdFeature(pDevIns->Internal.s.pVMRC, CPUMCPUIDFEATURE_APIC);
    593595            break;
    594596        default:
    595             AssertMsgFailed(("Unknown APIC version: %d\n", (int)enmVersion));
     597            AssertMsgFailed(("Unknown APIC mode: %d\n", (int)enmMode));
    596598    }
    597599}
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