Bug Report: FVP_Base_RevC-2xAEMvA 11.30.27 GICv3Redistributor legacy SGI 13-bit key lookup mismatch

Product: Arm Fast Models FVP_Base_RevC-2xAEMvA
Version: 11.30.27 (Nov 14 2025)
Host Environment: Ubuntu 24.04.3 LTS (x86_64)
Modes Affected: Both gicv3.gicv2-only=1 and GICv3 legacy ARE=0 (gicv3.gicv2-only=0, gic_distributor.ARE-fixed-to-one=0, gic_distributor.non-ARE-core-count=4)

Summary

GICv3Redistributor / GICv3-PITS: legacy SGI 13-bit (CPUID << 10) | SGI_ID vs. bare 10-bit SGI_ID lookup mismatch across GICD_CPENDSGIRn, GICD_ICENABLER0, and GICD_ISACTIVER0.

Description

In legacy GICv2 / ARE=0 mode on FVP_Base_RevC-2xAEMvA 11.30.27, GenericTrace.so traces and bare-metal tests show that GICv3Redistributor inserts pending legacy SGIs into its Pending Interrupt Tracking Structure (GICv3-PITS) carrying the 13-bit composite identifier (CPUID << 10) | SGI_ID (for example, 0x0404 for CPUID=1, SGI=4), whereas clear, disable, and active-filtering operations look up or mask only the bare 10-bit SGI_ID (CPUID == 0).

This key mismatch produces three reproducible architectural conformance issues whenever the source CPUID is non-zero:

  1. GICD_CPENDSGIRn (0xF10–0xF1C) does not evict cleared SGIs from CPUID 1..3:
    • Writing 1 (8-bit STRB or 32-bit STR) clears GICD_SPENDSGIRn to 0x00000000, yet GICC_HPPIR and GICC_IAR still return the cleared SGI (0x404, 0x405, 0xc00) instead of 0x3ff.
    • Unmasking IRQ (DAIF.I=0) delivers a phantom hardware IRQ (IRQ_COUNT=1, IAR=0x404) while GICD_SPENDSGIR1 == 0x0.
    • Disabling GICC_CTLR=0 (recalling 0x0404), clearing GICD_CPENDSGIR1=0x02, and re-enabling GICC_CTLR=3 causes GICv3-PITS to re-send COMMAND=Set(0x0404).
  2. GICD_ICENABLER0 (0x180) does not evict disabled SGIs from CPUID 1..3 (when legacy-sgi-enable-rao=0):
    • Clearing GICD_ISENABLER0[4] (0xffffffff -> 0xffffffef) emits GICv3_Handle_Clear_Interrupt only for bare 0x0004 (CPUID=0). Pending SGIs from source CPUIDs 1..3 (0x0404, 0x0804, 0x0c04) remain pending in GICv3-PITS and are still forwarded and acknowledged while GICD_ISENABLER0[4] == 0.
  3. GICD_ISACTIVER0 (0x300) and concurrent multi-source SGI active filtering:
    • Setting GICD_ISACTIVER0 = (1 << 4) suppresses CPUID=0 (0x0004 -> 0x3ff) while leaving CPUID=1 (0x0404) visible in GICC_HPPIR and GICC_IAR.
    • When two source PEs concurrently pend SGI 4 (e.g., 0x0004 + 0x0404 under EOImodeS=0, or 0x0404 + 0x0804 under EOImodeS=1), TrackActive(0x4) does not block the non-zero source entry, delivering a re-entrant hardware IRQ (0x0804) while SGI 4 is already active (GICD_ISACTIVER0 == 0x10).

Expected Behavior

Per Arm IHI 0048B.b (sections 3.2.1, 3.2.2, 3.2.4, 4.3.6, 4.3.9, 4.3.15, 4.3.16, 4.4.4, 4.4.7, 4.5) and Arm IHI 0069H.b (sections 5.3, 12.9.3 GICD_CPENDSGIR<n>, 12.9.7 GICD_ICENABLER<n>, 12.9.34 GICD_ISACTIVER<n>):

  • Clearing an SGI source pending bit via GICD_CPENDSGIRn must recall that (CPUID, SGI) pending instance so GICC_HPPIR and GICC_IAR return 0x3ff and no phantom IRQ fires.
  • Disabling an SGI via GICD_ICENABLER0 (when legacy-sgi-enable-rao=0) must prevent forwarding pending instances from all source CPUs.
  • While SGI n is active (GICD_ISACTIVER0[n] == 1), no pending instance of SGI n from any source CPU may be forwarded or acknowledged until deactivated.

Paired controls (GICD_ICPENDR0/1 PPI 25 & SPI 40, CPUID=0 SGI 4, sequential arrival, and same-source active-and-pending) all pass on the same FVP configuration.

Steps to Reproduce

Clone or download the public standalone source-only reproducer Gist below and run:

ARM_FVP=/path/to/FVP_Base_RevC-2xAEMvA ./reproducer/run.sh

Public standalone reproducer files (Gist): https://gist.github.com/canxin121/4d183e2f09f9aa56cdcde5e476cb8bcb

Best regards,
Xudong Zhang