Correct IROUTER base address
Using void pointer for IROUTER register address
Correct pointer arithmatic considering 32bit register per IRQ

Signed-off-by: Nikhil Devshatwar <[email protected]>
---
 hypervisor/arch/arm-common/gic-v3.c          | 2 +-
 hypervisor/arch/arm-common/include/asm/gic.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hypervisor/arch/arm-common/gic-v3.c 
b/hypervisor/arch/arm-common/gic-v3.c
index af51632..5a2b9bc 100644
--- a/hypervisor/arch/arm-common/gic-v3.c
+++ b/hypervisor/arch/arm-common/gic-v3.c
@@ -194,7 +194,7 @@ static void gic_cpu_shutdown(struct per_cpu *cpu_data)
 
 static void gic_adjust_irq_target(struct cell *cell, u16 irq_id)
 {
-       void *irouter = gicd_base + GICD_IROUTER + irq_id;
+       void *irouter = gicd_base + GICD_IROUTER - 32 + irq_id * 4;
        u32 route = mmio_read32(irouter);
 
        if (!cell_owns_cpu(cell, route))
diff --git a/hypervisor/arch/arm-common/include/asm/gic.h 
b/hypervisor/arch/arm-common/include/asm/gic.h
index 35f48dc..2490042 100644
--- a/hypervisor/arch/arm-common/include/asm/gic.h
+++ b/hypervisor/arch/arm-common/include/asm/gic.h
@@ -38,7 +38,7 @@
 #define GICD_SGIR                      0x0f00
 #define GICD_CPENDSGIR                 0x0f10
 #define GICD_SPENDSGIR                 0x0f20
-#define GICD_IROUTER                   0x6000
+#define GICD_IROUTER                   0x6100
 
 #define GICD_PIDR2_ARCH(pidr)          (((pidr) & 0xf0) >> 4)
 
-- 
1.9.1

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to