Skip to contentSkip to conversation

irqchip: gic: use dmb ishst instead of dsb when raising a softirq

PATCH New Will Deacon 2 participants 3 messages Feb 20, 2014 – Feb 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip: gic: use dmb ishst instead of dsb when raising a softirq

When sending an SGI to another CPU, we require a barrier to ensure that any pending stores to normal memory are made visible to the recipient before the interrupt arrives.

Rather than use a vanilla dsb() (which will soon cause an assembly error on arm64) before the writel_relaxed, we can instead use dsb(ishst), since we just need to ensure that any pending normal writes are visible within the inner-shareable domain before we poke the GIC.

With this observation, we can then further weaken the barrier to a dmb(ishst), since other CPUs in the inner-shareable domain must observe the write to the distributor before the SGI is generated.

---

Hi Olof,

Please can you take this via arm-soc for 3.15? That will let me activate the new barrier options for arm64 at the end of the next merge window (in the meantime, you can pass them but they are ignored).

Cheers,

Will

 drivers/irqchip/irq-gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-gic.c +2 -2
index 341c6016812d..500e533b9648 100644
@@ -661,9 +661,9 @@ void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
 
 	/*
 	 * Ensure that stores to Normal memory are visible to the
-	 * other CPUs before issuing the IPI.
+	 * other CPUs before they observe us issuing the IPI.
 	 */
-	dsb();
+	dmb(ishst);
 
 	/* this always happens on GIC0 */
 	writel_relaxed(map << 16 | irq, gic_data_dist_base(&gic_data[0]) + GIC_DIST_SOFTINT);
Signature · 1 line
1.8.2.2
#1 lore raw

PATCH 1/1 irqchip: gic: use dmb ishst instead of dsb when raising a softirq

Quoted 17 lines · Will Deacon

When sending an SGI to another CPU, we require a barrier to ensure that any pending stores to normal memory are made visible to the recipient before the interrupt arrives.

Rather than use a vanilla dsb() (which will soon cause an assembly error on arm64) before the writel_relaxed, we can instead use dsb(ishst), since we just need to ensure that any pending normal writes are visible within the inner-shareable domain before we poke the GIC.

With this observation, we can then further weaken the barrier to a dmb(ishst), since other CPUs in the inner-shareable domain must observe the write to the distributor before the SGI is generated.

Quoted 7 lines

---

Hi Olof,

Please can you take this via arm-soc for 3.15? That will let me activate the new barrier options for arm64 at the end of the next merge window (in the meantime, you can pass them but they are ignored).

I still can't see this in -next, any chance you could queue it please?

Will

#2 lore raw

PATCH 1/1 irqchip: gic: use dmb ishst instead of dsb when raising a softirq

Quoted 20 lines · Will Deacon
Quoted 19 lines · Will Deacon

When sending an SGI to another CPU, we require a barrier to ensure that any pending stores to normal memory are made visible to the recipient before the interrupt arrives.

Rather than use a vanilla dsb() (which will soon cause an assembly error on arm64) before the writel_relaxed, we can instead use dsb(ishst), since we just need to ensure that any pending normal writes are visible within the inner-shareable domain before we poke the GIC.

With this observation, we can then further weaken the barrier to a dmb(ishst), since other CPUs in the inner-shareable domain must observe the write to the distributor before the SGI is generated.

---

Quoted 8 lines
Quoted 5 lines

Hi Olof,

Please can you take this via arm-soc for 3.15? That will let me activate the new barrier options for arm64 at the end of the next merge window (in the meantime, you can pass them but they are ignored).

I still can't see this in -next, any chance you could queue it please?

Applied to next/fixes-non-critical

Arnd