xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
authorJulien Grall <julien.grall@citrix.com>
Wed, 18 Nov 2015 16:42:38 +0000 (16:42 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 25 Nov 2015 11:56:35 +0000 (11:56 +0000)
Each ITARGETSR register are 4-byte wide and the offset is in byte.

The current implementation is computing the end of the range wrongly
resulting to emulate only ITARGETSR{0,1} read-only. The rest will be
treated as read-write.

As 8 registers should be read-only, the end of the range should be
ITARGETSR + (4 * 8) - 1.

For convenience introduce ITARGETSR7 and ITARGETSR8.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen/arch/arm/vgic-v2.c
xen/include/asm-arm/gic.h

index f7d784bf4d41e943cdf8de7c9d7b4e2412e736b7..041291c899b70dde415eab3694a657fc637df792 100644 (file)
@@ -338,11 +338,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
                v, r, gicd_reg - GICD_ICACTIVER);
         return 0;
 
-    case GICD_ITARGETSR ... GICD_ITARGETSR + 7:
+    case GICD_ITARGETSR ... GICD_ITARGETSR7:
         /* SGI/PPI target is read only */
         goto write_ignore_32;
 
-    case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
+    case GICD_ITARGETSR8 ... GICD_ITARGETSRN:
     {
         /* unsigned long needed for find_next_bit */
         unsigned long target;
index 01164810eda695a56d7c10121d42981cd02b5263..3064d1c00f19b3660b02cb82523e04fa6bd4f320 100644 (file)
@@ -42,6 +42,8 @@
 #define GICD_IPRIORITYR (0x400)
 #define GICD_IPRIORITYRN (0x7F8)
 #define GICD_ITARGETSR  (0x800)
+#define GICD_ITARGETSR7 (0x81C)
+#define GICD_ITARGETSR8 (0x820)
 #define GICD_ITARGETSRN (0xBF8)
 #define GICD_ICFGR      (0xC00)
 #define GICD_ICFGRN     (0xCFC)