Skip to contentSkip to conversation

hw/intc/arm_gic: honor target mask in gic_update()

PATCH Applied Sergey Fedorov 3 participants 4 messages Aug 13, 2014 – Aug 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/arm_gic: honor target mask in gic_update()

Take IRQ target mask into account when determining the highest priority pending interrupt.

---
 hw/intc/arm_gic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/arm_gic.c +2 -1
index 1532ef9..a5ad7b9 100644
@@ -66,7 +66,8 @@ void gic_update(GICState *s)
         best_prio = 0x100;
         best_irq = 1023;
         for (irq = 0; irq < s->num_irq; irq++) {
-            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm)) {
+            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm) &&
+                (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) {
                 if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {
                     best_prio = GIC_GET_PRIORITY(irq, cpu);
                     best_irq = irq;
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Sergey Fedorov

Take IRQ target mask into account when determining the highest priority pending interrupt.

---
 hw/intc/arm_gic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/arm_gic.c +2 -1
index 1532ef9..a5ad7b9 100644
@@ -66,7 +66,8 @@ void gic_update(GICState *s)
         best_prio = 0x100;
         best_irq = 1023;
         for (irq = 0; irq < s->num_irq; irq++) {
-            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm)) {
+            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm) &&
+                (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) {
                 if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {
                     best_prio = GIC_GET_PRIORITY(irq, cpu);
                     best_irq = irq;
Signature · 1 line
1.9.1
#2 lore raw
In reply to Sergey Fedorov

Ping.

Quoted 22 lines · Sergey Fedorov

Take IRQ target mask into account when determining the highest priority pending interrupt.

---
 hw/intc/arm_gic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/intc/arm_gic.c +2 -1
index 1532ef9..a5ad7b9 100644
@@ -66,7 +66,8 @@ void gic_update(GICState *s)
         best_prio = 0x100;
         best_irq = 1023;
         for (irq = 0; irq < s->num_irq; irq++) {
-            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm)) {
+            if (GIC_TEST_ENABLED(irq, cm) && gic_test_pending(s, irq, cm) &&
+                (irq < GIC_INTERNAL || GIC_TARGET(irq) & cm)) {
                 if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {
                     best_prio = GIC_GET_PRIORITY(irq, cpu);
                     best_irq = irq;