xen/arm: vgic-v3: Don't try to emulate IROUTER which do not exist in the spec
authorJulien Grall <julien.grall@citrix.com>
Wed, 18 Nov 2015 17:27:57 +0000 (17:27 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 25 Nov 2015 12:29:27 +0000 (12:29 +0000)
The range of valid IROUTER<n> are n = 32 - 1019 (see 8.9.13 in IHI 0069A)
which correspond to the offset 0x6100-0x7FD8.

Other offsets are invalid and therefore should not be emulated.

Also remove the now unused label read_as_zero_64 and write_ignore_64.

Note that GICD_IROUTER is kept to accommodate the GICv3 drivers which has
been in part taken from Linux.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/vgic-v3.c
xen/include/asm-arm/gic_v3_defs.h

index 3a7b86fcf965ec9fbbd3b5d352c6e93c7afceaaf..902f64a78805c123c39bbf00d9b9564bf8610dff 100644 (file)
@@ -806,10 +806,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info,
          * Manage in common
          */
         return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto read_as_zero_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -887,11 +884,6 @@ bad_width:
     domain_crash_synchronous();
     return 0;
 
-read_as_zero_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    *r = 0;
-    return 1;
-
 read_as_zero_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     *r = 0;
@@ -974,10 +966,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
          * Manage in common */
         return __vgic_v3_distr_common_mmio_write("vGICD", v, info,
                                                  gicd_reg, r);
-    case GICD_IROUTER ... GICD_IROUTER31:
-        /* SGI/PPI is RES0 */
-        goto write_ignore_64;
-    case GICD_IROUTER32 ... GICD_IROUTERN:
+    case GICD_IROUTER32 ... GICD_IROUTER1019:
     {
         uint64_t irouter;
 
@@ -1039,10 +1028,6 @@ write_ignore_32:
     if ( dabt.size != DABT_WORD ) goto bad_width;
     return 1;
 
-write_ignore_64:
-    if ( vgic_reg64_check_access(dabt) ) goto bad_width;
-    return 1;
-
 write_ignore:
     return 1;
 }
index c6d73df4a8af4c11a4deb81903939a555b3c255e..89a354814dbdb180f0b656dc5bade9d0980db5a7 100644 (file)
@@ -29,9 +29,8 @@
 #define GICD_SETSPI_SR               (0x050)
 #define GICD_CLRSPI_SR               (0x058)
 #define GICD_IROUTER                 (0x6000)
-#define GICD_IROUTER31               (0x60F8)
 #define GICD_IROUTER32               (0x6100)
-#define GICD_IROUTERN                (0x7FF8)
+#define GICD_IROUTER1019             (0x7FD8)
 #define GICD_PIDR0                   (0xFFE0)
 #define GICD_PIDR1                   (0xFFE4)
 #define GICD_PIDR2                   (0xFFE8)