Skip to contentSkip to conversation

xen/arm: gic-v3: Make sure read from ICC_IAR1_EL1 is visible on the redistributor

PATCH In review Julien Grall 2 participants 2 messages Jan 18, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: gic-v3: Make sure read from ICC_IAR1_EL1 is visible on the redistributor

From the GICv3 spec (IHI069C) section 4.1.1:
"The effects of reading ICC_IAR0_EL1 and ICC_IAR1_EL1 on the state of a returned INTID are not guaranteed to be visible until after the execution of a DSB".

Because of the GIC is an external component, a dsb sy is required. Without it the sysreg read may not have been made visible on the redistributor.

---

This patch should be backported up to Xen 4.6.

---
 xen/arch/arm/gic-v3.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
xen/arch/arm/gic-v3.c +5 -1
index 57ed9d9..955591b 100644
@@ -459,7 +459,11 @@ static void gicv3_dir_irq(struct irq_desc *irqd)
 
 static unsigned int gicv3_read_irq(void)
 {
-    return READ_SYSREG32(ICC_IAR1_EL1);
+    unsigned int irq = READ_SYSREG32(ICC_IAR1_EL1);
+
+    dsb(sy);
+
+    return irq;
 }
 
 static inline uint64_t gicv3_mpidr_to_affinity(int cpu)
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Julien Grall
Quoted 1 line

From the GICv3 spec (IHI069C) section 4.1.1:

"The effects of reading ICC_IAR0_EL1 and ICC_IAR1_EL1 on the state of a returned INTID are not guaranteed to be visible until after the execution of a DSB".

Because of the GIC is an external component, a dsb sy is required. Without it the sysreg read may not have been made visible on the redistributor.

Quoted 27 lines

---

This patch should be backported up to Xen 4.6.

---
 xen/arch/arm/gic-v3.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
xen/arch/arm/gic-v3.c +5 -1
index 57ed9d9..955591b 100644
@@ -459,7 +459,11 @@ static void gicv3_dir_irq(struct irq_desc *irqd)
 
 static unsigned int gicv3_read_irq(void)
 {
-    return READ_SYSREG32(ICC_IAR1_EL1);
+    unsigned int irq = READ_SYSREG32(ICC_IAR1_EL1);
+
+    dsb(sy);
+
+    return irq;
 }
 
 static inline uint64_t gicv3_mpidr_to_affinity(int cpu)
Signature · 1 line
1.9.1

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel