VirtualBox

Changeset 60430 in vbox for trunk/src/VBox


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

VMM/APIC: Fixes.

File:
1 edited

Legend:

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

    r60428 r60430  
    440440 *                              performed in the current context.
    441441 */
    442 static VBOXSTRICTRC apicSendIntr(PVMCPU pVCpu, uint8_t uVector, XAPICTRIGGERMODE enmTriggerMode,
     442static VBOXSTRICTRC apicSendIntr(PVM pVM, PVMCPU pVCpu, uint8_t uVector, XAPICTRIGGERMODE enmTriggerMode,
    443443                                 XAPICDELIVERYMODE enmDeliveryMode, PCVMCPUSET pDestCpuSet, int rcRZ)
    444444{
    445445    VBOXSTRICTRC  rcStrict = VINF_SUCCESS;
    446     PVM           pVM      = pVCpu->CTX_SUFF(pVM);
    447446    VMCPUID const cCpus    = pVM->cCpus;
    448447    switch (enmDeliveryMode)
     
    816815    }
    817816
    818     return apicSendIntr(pVCpu, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet, rcRZ);
     817    return apicSendIntr(pVCpu->CTX_SUFF(pVM), pVCpu, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet, rcRZ);
    819818}
    820819
     
    11951194              || offLvt == XAPIC_OFF_LVT_LINT1
    11961195              || offLvt == XAPIC_OFF_LVT_ERROR,
    1197              ("APIC%u: apicSetLvtEntry: invalid offset, offLvt=%#x, uLvt=%#x\n", pVCpu->idCpu, offLvt, uLvt));
     1196             ("APIC%u: apicSetLvtEntry: invalid offset, offLvt=%#RX16, uLvt=%#RX32\n", pVCpu->idCpu, offLvt, uLvt));
    11981197
    11991198    /*
     
    12481247        apicSetError(pVCpu, XAPIC_ESR_SEND_ILLEGAL_VECTOR);
    12491248
     1249    Log4(("APIC%u: apicSetLvtEntry: offLvt=%#RX16 uLvt=%#RX32\n", pVCpu->idCpu, offLvt, uLvt));
    12501250    apicWriteRaw32(pXApicPage, offLvt, uLvt);
    12511251    return VINF_SUCCESS;
     
    12681268{
    12691269    VMCPU_ASSERT_EMT(pVCpu);
    1270     AssertMsg(offLvt == XAPIC_OFF_CMCI, ("APIC%u: apicSetLvt1Entry: invalid offset %#x\n", pVCpu->idCpu, offLvt));
     1270    AssertMsg(offLvt == XAPIC_OFF_CMCI, ("APIC%u: apicSetLvt1Entry: invalid offset %#RX16\n", pVCpu->idCpu, offLvt));
    12711271
    12721272    /** @todo support CMCI. */
     
    13901390        {
    13911391            Assert(!XAPIC_IN_X2APIC_MODE(pVCpu));
    1392             rc = PDMDevHlpDBGFStop(pApicDev->CTX_SUFF(pDevIns), RT_SRC_POS, "offReg=%#x Id=%u\n", offReg, pVCpu->idCpu);
     1392            rc = PDMDevHlpDBGFStop(pApicDev->CTX_SUFF(pDevIns), RT_SRC_POS, "VCPU[%u]: offReg=%#RX16\n", pVCpu->idCpu, offReg);
    13931393            apicSetError(pVCpu, XAPIC_ESR_ILLEGAL_REG_ADDRESS);
    13941394            break;
     
    15031503        }
    15041504
     1505        /* Read-only, write ignored: */
     1506        case XAPIC_OFF_VERSION:
     1507        case XAPIC_OFF_ID:
     1508            break;
     1509
    15051510        /* Unavailable/reserved in xAPIC mode: */
    15061511        case X2APIC_OFF_SELF_IPI:
    15071512        /* Read-only registers: */
    1508         case XAPIC_OFF_ID:
    1509         case XAPIC_OFF_VERSION:
    15101513        case XAPIC_OFF_PPR:
    15111514        case XAPIC_OFF_ISR0:    case XAPIC_OFF_ISR1:    case XAPIC_OFF_ISR2:    case XAPIC_OFF_ISR3:
     
    15181521        default:
    15191522        {
    1520             rcStrict = PDMDevHlpDBGFStop(pApicDev->CTX_SUFF(pDevIns), RT_SRC_POS, "APIC%u: offReg=%#x\n", pVCpu->idCpu, offReg);
     1523            rcStrict = PDMDevHlpDBGFStop(pApicDev->CTX_SUFF(pDevIns), RT_SRC_POS, "APIC%u: offReg=%#RX16\n", pVCpu->idCpu,
     1524                                         offReg);
    15211525            apicSetError(pVCpu, XAPIC_ESR_ILLEGAL_REG_ADDRESS);
    15221526            break;
     
    19471951    VMCPUSET DestCpuSet;
    19481952    apicGetDestCpuSet(pVM, fDestMask, fBroadcastMask, enmDestMode, enmDeliveryMode, &DestCpuSet);
    1949     VBOXSTRICTRC rcStrict = apicSendIntr(NULL /* pVCpu */, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet, VINF_SUCCESS);
     1953    VBOXSTRICTRC rcStrict = apicSendIntr(pVM, NULL /* pVCpu */, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet,
     1954                                         VINF_SUCCESS /* rcRZ */);
    19501955    return VBOXSTRICTRC_VAL(rcStrict);
    19511956}
     
    20022007                case XAPICDELIVERYMODE_NMI:
    20032008                case XAPICDELIVERYMODE_INIT:    /** @todo won't work in R0/RC because callers don't care about rcRZ. */
    2004                 case XAPICDELIVERYMODE_EXTINT:
    20052009                {
    20062010                    VMCPUSET DestCpuSet;
     
    20082012                    VMCPUSET_ADD(&DestCpuSet, pVCpu->idCpu);
    20092013                    uint8_t const uVector = XAPIC_LVT_GET_VECTOR(uLvt);
    2010 
    2011                     Log4(("APIC%u: APICLocalInterrupt: Sending interrupt. enmDeliveryMode=%u u8Pin=%u uVector=%u\n",
    2012                           pVCpu->idCpu, enmDeliveryMode, u8Pin, uVector));
    2013 
    2014                     rcStrict = apicSendIntr(pVCpu, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet, rcRZ);
     2014                    rcStrict = apicSendIntr(pVCpu->CTX_SUFF(pVM), pVCpu, uVector, enmTriggerMode, enmDeliveryMode, &DestCpuSet,
     2015                                            rcRZ);
     2016                    break;
     2017                }
     2018
     2019                case XAPICDELIVERYMODE_EXTINT:
     2020                {
     2021                    Log4(("APIC%u: APICLocalInterrupt: External interrupt. u8Pin=%u u8Level=%u\n", pVCpu->idCpu, u8Pin, u8Level));
     2022                    if (u8Level)
     2023                        APICSetInterruptFF(pVCpu, PDMAPICIRQ_EXTINT);
     2024                    else
     2025                        APICClearInterruptFF(pVCpu, PDMAPICIRQ_EXTINT);
    20152026                    break;
    20162027                }
     
    21482159#endif
    21492160
    2150     LogRel(("APIC%u: APICWriteMmio: offReg=%#RX16\n", pVCpu->idCpu, offReg));
     2161    LogRel(("APIC%u: APICWriteMmio: offReg=%#RX16 uValue=%#RX32\n", pVCpu->idCpu, offReg, uValue));
    21512162
    21522163    int rc = VBOXSTRICTRC_VAL(apicWriteRegister(pApicDev, pVCpu, offReg, uValue));
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