target-arm: fix target CPUs on ARM GIC
PATCH 1/1 target-arm: fix target CPUs on ARM GIC
Fix a bug on the ARM GIC model where interrupts are not set pending on the correct target CPUs when they are triggered by writes to the Interrupt Set Enable or Set Pending registers.
Signed-off-by Daniel Sangorrin <[email protected]>
--- hw/arm_gic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/arm_gic.c +3 -2
@@ -374,7 +374,8 @@ static void gic_dist_writeb(void *opaque, hwaddr offset, value =0xff ;for (i =0 ; i <8 ; i++) {if (value & (1 << i)) { -int mask = (irq <GIC_INTERNAL ) ? (1 << cpu) :GIC_TARGET (irq); +int mask = + (irq <GIC_INTERNAL ) ? (1 << cpu) :GIC_TARGET (irq + i);int cm = (irq <GIC_INTERNAL ) ? (1 << cpu) :ALL_CPU_MASK ;if (!GIC_TEST_ENABLED (irq + i, cm)) {
@@ -417,7 +418,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset,for (i =0 ; i <8 ; i++) {if (value & (1 << i)) { -GIC_SET_PENDING (irq + i,GIC_TARGET (irq)); +GIC_SET_PENDING (irq + i,GIC_TARGET (irq + i)); } } }else if (offset <0x300 ) {
Signature · 1 line
1.7.9.5
Quoted 6 lines · On 10 December 2012 03:32, <[email protected]> wrote:
Fix a bug on the ARM GIC model where interrupts are not set pending on the correct target CPUs when they are triggered by writes to the Interrupt Set Enable or Set Pending registers.
Signed-off-by Daniel Sangorrin <[email protected]>
Reviewed-by Peter Maydell <[email protected]>
Thanks -- applied to the arm-devs.next tree.
-- PMM