]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: vgic-v2: Implement correctly ITARGETSR0 - ITARGETSR7 read-only
authorJulien Grall <julien.grall@citrix.com>
Fri, 4 Mar 2016 12:13:22 +0000 (13:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Mar 2016 12:13:22 +0000 (13:13 +0100)
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>
(cherry picked from commit bc50de883847c1ebc7c8b4d73283d9be6c4df38e)

xen/arch/arm/vgic-v2.c
xen/include/asm-arm/gic.h

index 86d362879b0ac50c4234e6dbe9a17a78712273a0..d0616e612e5a4f0e66ab94accb49c7b5597a9697 100644 (file)
@@ -361,11 +361,11 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         vgic_unlock_rank(v, rank, flags);
         return 1;
 
-    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 0396a8eed04ab578031aa2e22052d9f91d346219..d31c74f07a9cc51b530fc9173bb107200386ff48 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)