VirtualBox

Changeset 108427 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Mar 4, 2025 8:21:36 AM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167801
Message:

VMM/GIC: bugref:10404 Extend the interrupt lines to the full extent supported by the GIC spec.
Added range-selector support while broadcasting SGIs.
Added highest priority interrupt calculation (still not complete, binary-point support is still a todo)
Other miscellaneous changes related to the above.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/GICInternal.h

    r108412 r108427  
    7171#define GIC_SPI_MAX                         32
    7272
     73/** @def GIC_CACHE_LINE_SIZE
     74 * Padding (in bytes) for aligning data in different cache lines. The ARMv8 cache
     75 * line size is 64 bytes.
     76 *
     77 * See ARM spec "Cache Size ID Register, CCSIDR_EL1".
     78 */
     79#define GIC_CACHE_LINE_SIZE                64
     80
     81#if 1
     82/**
     83 * GIC Interrupt-Delivery Bitmap (IDB).
     84 */
     85typedef struct GICIDB
     86{
     87    uint64_t volatile   au64IntIdBitmap[33];
     88    uint32_t volatile   fOutstandingNotification;
     89    uint8_t             abAlignment[52];
     90} GICIDB;
     91AssertCompileMemberOffset(GICIDB, fOutstandingNotification, 264);
     92AssertCompileSizeAlignment(GICIDB, GIC_CACHE_LINE_SIZE);
     93/** Pointer to a pending-interrupt bitmap. */
     94typedef GICIDB *PGICIDB;
     95/** Pointer to a const pending-interrupt bitmap. */
     96typedef const GICIDB *PCGICIDB;
     97#endif
     98
    7399/**
    74100 * GIC PDM instance data (per-VM).
     
    81107    IOMMMIOHANDLE               hMmioReDist;
    82108
     109    /** @name Distributor register state for SPIs and extended SPIs.
     110     * @{
     111     */
     112#if 1
     113    /** Interrupt group bitmap. */
     114    uint32_t                    bmIntrGroup[64];
     115    /** Interrupt config bitmap (edge-triggered vs level-sensitive). */
     116    uint32_t                    bmIntrConfig[128];
     117    /** Interrupt enabled bitmap. */
     118    uint32_t                    bmIntrEnabled[64];
     119    /** Interrupt pending bitmap. */
     120    uint32_t                    bmIntrPending[64];
     121    /** Interrupt active bitmap. */
     122    uint32_t                    bmIntrActive[64];
     123    /** Interrupt priorities. */
     124    uint8_t                     abIntrPriority[2048];
     125    /** Interrupt routing info. */
     126    uint32_t                    au32IntrRouting[2048];
     127    /** Interrupt routine mode bitmap. */
     128    uint32_t                    bmIntrRoutingMode[64];
     129
     130    /** Flag whether group 0 interrupts are enabled. */
     131    bool                        fIrqGrp0Enabled;
     132    /** Flag whether group 1 interrupts are enabled. */
     133    bool                        fIrqGrp1Enabled;
     134    /** Flag whether affinity routing is enabled. */
     135    bool                        fAffRoutingEnabled;
     136    /** Padding. */
     137    bool                        afPadding;
     138    /** @} */
     139#else
    83140    /** @name SPI distributor register state.
    84141     * @{ */
     
    105162    volatile bool               fIrqGrp1Enabled;
    106163    /** @} */
     164#endif
    107165
    108166    /** @name Configurables.
    109167     * @{ */
     168    /** The maximum SPI supported (GICD_TYPER.ItsLinesNumber). */
     169    uint16_t                    uMaxSpi;
     170    /** Maximum extended SPI supported (GICR_TYPER.ESPI_range).  */
     171    uint16_t                    uMaxExtSpi;
    110172    /** The GIC architecture (GICD_PIDR2.ArchRev and GICR_PIDR2.ArchRev). */
    111173    uint8_t                     uArchRev;
     
    116178    /** Whether NMIs are supported (GICD_TYPER.NMI). */
    117179    bool                        fNmi;
    118     /** The maximum SPI supported (GICD_TYPER.ItsLinesNumber). */
    119     uint16_t                    uMaxSpi;
    120     /** Maximum extended SPI supported (GICR_TYPER.ESPI_range).  */
    121     uint16_t                    uMaxExtSpi;
     180    /** Whether range-selector is supported (GICD_TYPER.RSS and ICC_CTLR_EL1.RSS). */
     181    bool                        fRangeSelSupport;
    122182    /** @} */
    123183} GICDEV;
     
    157217    /** @name SGI and PPI redistributor register state.
    158218     * @{ */
     219#if 1
     220    /** Interrupt group bitmap. */
     221    uint32_t                    bmIntrGroup[3];
     222    /** Interrupt config bitmap (edge-triggered vs level-sensitive). */
     223    uint32_t                    bmIntrConfig[6];
     224    /** Interrupt enabled bitmap. */
     225    uint32_t                    bmIntrEnabled[3];
     226    /** Interrupt pending bitmap. */
     227    uint32_t                    bmIntrPending[3];
     228    /** Interrupt active bitmap. */
     229    uint32_t                    bmIntrActive[3];
     230    /** Interrupt priorities. */
     231    uint8_t                     abIntrPriority[96];
     232    /** Flag indicating register write pending (GICR_CTLR.RWP). */
     233    bool                        fRegWritePending;
     234#else
    159235    /** Interrupt Group 0 Register. */
    160236    volatile uint32_t           u32RegIGrp0;
     
    171247    /** The interrupt priority for each of the SGI/PPIs */
    172248    volatile uint8_t            abIntPriority[GIC_INTID_RANGE_PPI_LAST + 1];
     249#endif
    173250    /** @} */
    174251
    175252    /** @name ICC system register state.
    176253     * @{ */
     254    /** The control register (ICC_CTLR_EL1). */
     255    uint64_t                    uIccCtlr;
    177256    /** Flag whether group 0 interrupts are currently enabled. */
    178     volatile bool               fIrqGrp0Enabled;
     257    bool                        fIrqGrp0Enabled;
    179258    /** Flag whether group 1 interrupts are currently enabled. */
    180     volatile bool               fIrqGrp1Enabled;
     259    bool                        fIrqGrp1Enabled;
    181260    /** The current interrupt priority, only interrupts with a higher priority get signalled. */
    182     volatile uint8_t            bInterruptPriority;
     261    uint8_t                     bInterruptPriority;
    183262    /** The interrupt controller Binary Point Register for Group 0 interrupts. */
    184263    uint8_t                     bBinaryPointGrp0;
     
    186265    uint8_t                     bBinaryPointGrp1;
    187266    /** The running priorities caused by preemption. */
    188     volatile uint8_t            abRunningPriorities[256];
     267    uint8_t                     abRunningPriorities[256];
    189268    /** The index to the current running priority. */
    190     volatile uint8_t            idxRunningPriority;
     269    uint8_t                     idxRunningPriority;
    191270    /** @} */
    192271
     
    235314DECL_HIDDEN_CALLBACK(VBOXSTRICTRC)      gicReDistMmioWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb);
    236315
    237 DECLHIDDEN(void)                        gicResetCpu(PVMCPUCC pVCpu);
     316DECLHIDDEN(void)                        gicResetCpu(PPDMDEVINS pDevIns, PVMCPUCC pVCpu);
     317DECLHIDDEN(void)                        gicReset(PPDMDEVINS pDevIns);
     318DECLHIDDEN(uint16_t)                    gicReDistGetIntIdFromIndex(uint16_t idxIntr);
     319DECLHIDDEN(uint16_t)                    gicDistGetIntIdFromIndex(uint16_t idxIntr);
    238320
    239321DECLCALLBACK(int)                       gicR3Construct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfg);
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