irqchip/gic-v3: Ensure change to DS is visible
Subsystems (2)
PATCH 1/1 irqchip/gic-v3: Ensure change to DS is visible
Sashiko reported missing GIC synchronization when the FLAGS_WORKAROUND_INSECURE path modifies DS. Specifically, an immediate read of the DS state after the write might not observe the effect of that write, which can lead to misreporting the DS state.
Updates to the DS bit are tracked by RWP, so poll it after the write before proceeding to read back the DS state.
--- drivers/irqchip/irq-gic-v3.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/irqchip/irq-gic-v3.c +2 -0
@@ -164,6 +164,7 @@ static inline bool gic_dist_security_disabled(void)static bool cpus_have_security_disabled__ro_after_init ;static bool cpus_have_group0__ro_after_init ; +static void gic_dist_wait_for_rwp (void );static void __init gic_prio_init (void ) {
@@ -179,6 +180,7 @@ static void __init gic_prio_init(void) val =readl_relaxed (gic_data.dist_base +GICD_CTLR ); val |=GICD_CTLR_DS ;writel_relaxed (val, gic_data.dist_base +GICD_CTLR ); +gic_dist_wait_for_rwp (); ds =gic_dist_security_disabled ();if (ds)
Signature · 1 line
2.34.1
Quoted 27 lines · Vladimir Murzin
Sashiko reported missing GIC synchronization when the
FLAGS_WORKAROUND_INSECUREpath modifies DS. Specifically, an immediate read of the DS state after the write might not observe the effect of that write, which can lead to misreporting the DS state.Updates to the DS bit are tracked by RWP, so poll it after the write before proceeding to read back the DS state.
Signed-off-by Vladimir Murzin <[email protected]>--- drivers/irqchip/irq-gic-v3.c | 2 ++ 1 file changed, 2 insertions(+)drivers/irqchip/irq-gic-v3.c +1
-0@@ -164,6 +164,7 @@ static inline bool gic_dist_security_disabled(void)static bool cpus_have_security_disabled__ro_after_init ;static bool cpus_have_group0__ro_after_init ; +static void gic_dist_wait_for_rwp (void );static void __init gic_prio_init (void ) {
drivers/irqchip/irq-gic-v3.c static void __init gic_prio_init(void) · line 186
Quoted 7 lines
drivers/irqchip/irq-gic-v3.c +1
-0@@ -179,6 +180,7 @@ static void __init gic_prio_init(void) val =readl_relaxed (gic_data.dist_base +GICD_CTLR ); val |=GICD_CTLR_DS ;writel_relaxed (val, gic_data.dist_base +GICD_CTLR ); +gic_dist_wait_for_rwp (); ds =gic_dist_security_disabled ();if (ds)
Ah, well spotted. FWIW:
M.
Signature · 1 line
Jazz isn't dead. It just smells funny.
The following commit has been merged into the irq/drivers branch of tip:
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 254772534e40060abe5321093400947e03b13d54 Gitweb: https://git.kernel.org/tip/254772534e40060abe5321093400947e03b13d54 Author: Vladimir Murzin <[email protected]> AuthorDate: Wed, 30 Sep 2026 17:11:23 +01:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 15 Oct 2026 12:02:17 +02:00
irqchip/gic-v3: Ensure change to DS is visible
Sashiko reported missing GIC synchronization when the FLAGS_WORKAROUND_INSECURE path modifies DS. Specifically, an immediate read of the DS state after the write might not observe the effect of that write, which can lead to misreporting the DS state.
Updates to the DS bit are tracked by RWP, so poll it after the write before proceeding to read back the DS state.
--- drivers/irqchip/irq-gic-v3.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/irqchip/irq-gic-v3.c +2 -0
@@ -164,6 +164,7 @@ static inline bool gic_dist_security_disabled(void)static bool cpus_have_security_disabled__ro_after_init ;static bool cpus_have_group0__ro_after_init ; +static void gic_dist_wait_for_rwp (void );static void __init gic_prio_init (void ) {
@@ -179,6 +180,7 @@ static void __init gic_prio_init(void) val =readl_relaxed (gic_data.dist_base +GICD_CTLR ); val |=GICD_CTLR_DS ;writel_relaxed (val, gic_data.dist_base +GICD_CTLR ); +gic_dist_wait_for_rwp (); ds =gic_dist_security_disabled ();if (ds)