VirtualBox

Ignore:
Timestamp:
Mar 5, 2025 9:20:57 AM (7 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167822
Message:

VMM/GIC: bugref:10404 Use the function that combines getting the highest priority pending interrupt.

File:
1 edited

Legend:

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

    r108447 r108448  
    16531653
    16541654
     1655#if 0
    16551656/**
    16561657 * Gets the highest priority pending distributor interrupt that can be forwarded to
     
    18111812    return uIntId;
    18121813}
     1814#endif
    18131815
    18141816
     
    19871989    LogFlowFunc(("fGroup0=%RTbool fGroup1=%RTbool\n", fGroup0, fGroup1));
    19881990
    1989     /** @todo Later combine the redistributor and distributor interrupt
    1990      *        gathering.  */
    1991 
    19921991    /* Get highest priority pending interrupt from the distributor. */
    1993     uint8_t  bPriority;
    1994     uint16_t idxIntr;
    1995     uint16_t uIntId = gicDistGetHighestPrioPendingIntr(pGicDev, fGroup0, fGroup1, &idxIntr, &bPriority);
    1996 
    1997     /* Compare with the highest priority pending interrupt from the redistributor. */
    1998     PGICCPU  pGicCpu   = VMCPU_TO_GICCPU(pVCpu);
    1999     bool     fInRedist = false;
    2000     uint8_t  bPriorityRedist;
    2001     uint16_t idxRedistIntr;
    2002     uint16_t const uIntIdRedist = gicReDistGetHighestPrioPendingIntr(pGicCpu, fGroup0, fGroup1, &idxRedistIntr, &bPriorityRedist);
    2003     if (   uIntIdRedist != GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT
    2004         && bPriorityRedist < bPriority)
    2005     {
    2006         fInRedist = true;
    2007         bPriority = bPriorityRedist;
    2008         uIntId    = uIntIdRedist;
    2009         idxIntr   = idxRedistIntr;
    2010     }
    2011 
    2012     /* Sanity check if the interrupt ID is within known ranges. */
    2013     Assert(   GIC_IS_INTR_SGI_OR_PPI(uIntId)
    2014            || GIC_IS_INTR_SPI(uIntId)
    2015            || GIC_IS_INTR_EXT_PPI(uIntId)
    2016            || GIC_IS_INTR_EXT_SPI(uIntId)
    2017            || uIntId == GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT);
    2018     /* Ensure that if no interrupt is pending, the priority is appropriate. */
    2019     Assert(uIntId != GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT || bPriority == GIC_IDLE_PRIORITY);
     1992    uint8_t   bPriority;
     1993    uint16_t  idxIntr;
     1994    PGICCPU   pGicCpu = VMCPU_TO_GICCPU(pVCpu);
     1995    uint16_t const uIntId = gicGetHighestPrioPendingIntrEx(pGicDev, pGicCpu, fGroup0, fGroup1, &idxIntr, &bPriority);
    20201996
    20211997    /* Acknowledge the interrupt. */
    20221998    if (uIntId != GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT)
    20231999    {
    2024         if (fInRedist)
     2000        bool const fIsRedistIntId = GIC_IS_INTR_SGI_OR_PPI(uIntId) || GIC_IS_INTR_EXT_PPI(uIntId);
     2001        if (fIsRedistIntId)
    20252002        {
    20262003            /** @todo Check if the interrupt has sufficient priority (preemption level
     
    20532030             *        checking?). */
    20542031
     2032            /* Sanity check if the interrupt ID belongs to the distirbutor. */
     2033            Assert(GIC_IS_INTR_SPI(uIntId) || GIC_IS_INTR_EXT_SPI(uIntId));
     2034
    20552035            /* Mark the interrupt as active. */
    20562036            Assert(idxIntr < sizeof(pGicDev->bmIntrActive) * 8);
     
    20702050        }
    20712051    }
     2052    else
     2053        Assert(bPriority == GIC_IDLE_PRIORITY);
    20722054
    20732055    LogFlowFunc(("uIntId=%u\n", uIntId));
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