]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/intc/arm_gicv3_dist: Implement GICD_TYPER2 as 0
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 23 Oct 2025 12:12:49 +0000 (13:12 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 23 Oct 2025 12:12:49 +0000 (13:12 +0100)
The GIC distributor registers GICD_TYPER2 is present when the
GICv4.1 is implemented, and RES0 otherwise. QEMU's TCG implementation
is only GICv4.0, so this register is RES0. However, since it's
reasonable for GICv4.1-aware software to read the register, expecting
the zero for GICv3 and GICv4.0, implement the case to avoid it being
logged as an invalid guest read.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
hw/intc/arm_gicv3_dist.c
hw/intc/gicv3_internal.h

index d8207acb22ccdcce296466071a34c0ad473551b2..a7d10ed9493c8e100c2ae93348fed95b36722e14 100644 (file)
@@ -431,6 +431,15 @@ static bool gicd_readl(GICv3State *s, hwaddr offset,
             (0xf << 19) | itlinesnumber;
         return true;
     }
+    case GICD_TYPER2:
+        /*
+         * This register only exists for GICv4.1, which QEMU doesn't
+         * currently emulate. On GICv3 and GICv4 it's defined to be RES0.
+         * We implement as read-zero here to avoid tracing a bad-register-read
+         * if GICv4.1-aware software reads this ID register.
+         */
+        *data = 0;
+        return true;
     case GICD_IIDR:
         /* We claim to be an ARM r0p0 with a zero ProductID.
          * This is the same as an r0p0 GIC-500.
index bc9f518fe865cc83d2d3de6d16db8bc05bbe7fd0..fc586524f56081aeb958559669926d74f88edde4 100644 (file)
@@ -31,6 +31,7 @@
 #define GICD_CTLR            0x0000
 #define GICD_TYPER           0x0004
 #define GICD_IIDR            0x0008
+#define GICD_TYPER2          0x000C
 #define GICD_STATUSR         0x0010
 #define GICD_SETSPI_NSR      0x0040
 #define GICD_CLRSPI_NSR      0x0048