VirtualBox

Changeset 108450 in vbox for trunk/src


Ignore:
Timestamp:
Mar 5, 2025 10:43:28 AM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167824
Message:

VMM/GIC: bugref:10404 Clear pending state of edge-triggered interrupts on interrupt acknowledge.

File:
1 edited

Legend:

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

    r108449 r108450  
    10951095    {
    10961096        Assert(idxReg < RT_ELEMENTS(pGicDev->bmIntrConfig));
    1097         pGicDev->bmIntrConfig[idxReg] = uValue;
     1097        pGicDev->bmIntrConfig[idxReg] = uValue & 0xaaaaaaaa;
    10981098    }
    10991099    else
     
    13911391    /* When affinity routing is disabled, reads return 0. */
    13921392    Assert(pGicDev->fAffRoutingEnabled); RT_NOREF(pGicDev);
    1393     if (idxReg > 0)
    1394     {
    1395         Assert(idxReg < RT_ELEMENTS(pGicCpu->bmIntrConfig));
    1396         *puValue = pGicCpu->bmIntrConfig[idxReg];
    1397     }
    1398     else
    1399     {
    1400         /* SGIs are read-only and are always edge-triggered. */
    1401         *puValue = 0xaaaaaaaa;
    1402     }
     1393    Assert(idxReg < RT_ELEMENTS(pGicCpu->bmIntrConfig));
     1394    *puValue = pGicCpu->bmIntrConfig[idxReg];
     1395    /* Ensure SGIs are read-only and remain configured as edge-triggered. */
     1396    Assert(idxReg > 0 || *puValue == 0xaaaaaaaa);
    14031397    LogFlowFunc(("idxReg=%#x read %#x\n", idxReg, *puValue));
    14041398    return VINF_SUCCESS;
     
    14231417    {
    14241418        Assert(idxReg < RT_ELEMENTS(pGicCpu->bmIntrConfig));
    1425         pGicCpu->bmIntrConfig[idxReg] = uValue;
     1419        pGicCpu->bmIntrConfig[idxReg] = uValue & 0xaaaaaaaa;
    14261420    }
    14271421    else
    14281422    {
    1429         /* SGIs are always edge triggered ignore writes, verify value on strict builds (e.g. aarch64 Win11 writes this). */
     1423        /* SGIs are always edge-triggered ignore writes, verify value on strict builds (arm64 Win11 guests writes this). */
    14301424        Assert(uValue == 0xaaaaaaaa);
    14311425        Assert(pGicCpu->bmIntrConfig[0] == uValue);
     
    20192013            pGicCpu->abRunningPriorities[++pGicCpu->idxRunningPriority] = bPriority;
    20202014
    2021             /* Clear edge level interrupts like SGIs as pending. */
    2022             /** @todo do this for all edge-triggered? */
    2023             if (idxIntr <= GIC_INTID_RANGE_SGI_LAST)
     2015            /* If it is an edge-triggered interrupt, mark it as no longer pending. */
     2016            AssertRelease(2 * idxIntr + 1 < sizeof(pGicCpu->bmIntrConfig) * 8);
     2017            bool const fEdgeTriggered = ASMBitTest(&pGicCpu->bmIntrConfig[0], 2 * idxIntr + 1);
     2018            if (fEdgeTriggered)
    20242019                ASMBitClear(&pGicCpu->bmIntrPending[0], idxIntr);
    20252020
     
    20472042                         pGicCpu->idxRunningPriority, pGicCpu->idxRunningPriority + 1));
    20482043            pGicCpu->abRunningPriorities[++pGicCpu->idxRunningPriority] = bPriority;
     2044
     2045            /* If it is an edge-triggered interrupt, mark it as no longer pending. */
     2046            AssertRelease(2 * idxIntr + 1 < sizeof(pGicDev->bmIntrConfig) * 8);
     2047            bool const fEdgeTriggered = ASMBitTest(&pGicDev->bmIntrConfig[0], 2 * idxIntr + 1);
     2048            if (fEdgeTriggered)
     2049                ASMBitClear(&pGicDev->bmIntrPending[0], idxIntr);
    20492050
    20502051            /* Update the distributor IRQ state to reflect change in active interrupt. */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette