diff options
author | Rohan McLure <rmclure@linux.ibm.com> | 2023-05-10 13:31:13 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-06-21 15:13:57 +1000 |
commit | 8608f14b49a0a3f8644a326d32dc1bf7ed78836a (patch) | |
tree | 23039e9ef5b15191f0495689b247adad846e8b27 | |
parent | b0c5b4f1ee3687c57dab65ac0729a4d61967f032 (diff) | |
download | lwn-8608f14b49a0a3f8644a326d32dc1bf7ed78836a.tar.gz lwn-8608f14b49a0a3f8644a326d32dc1bf7ed78836a.zip |
powerpc: Annotate accesses to ipi message flags
IPI message flags are observed and consequently consumed in the
smp_ipi_demux_relaxed function, which handles these message sources
until it observes none more arriving. Mark the checked loop guard with
READ_ONCE, to signal to KCSAN that the read is known to be volatile, and
that non-determinism is expected. Mark write for message source in
smp_muxed_ipi_set_message().
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230510033117.1395895-8-rmclure@linux.ibm.com
-rw-r--r-- | arch/powerpc/kernel/smp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 265801a3e94c..406e6d0ffae3 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -291,7 +291,7 @@ void smp_muxed_ipi_set_message(int cpu, int msg) * Order previous accesses before accesses in the IPI handler. */ smp_mb(); - message[msg] = 1; + WRITE_ONCE(message[msg], 1); } void smp_muxed_ipi_message_pass(int cpu, int msg) @@ -350,7 +350,7 @@ irqreturn_t smp_ipi_demux_relaxed(void) if (all & IPI_MESSAGE(PPC_MSG_NMI_IPI)) nmi_ipi_action(0, NULL); #endif - } while (info->messages); + } while (READ_ONCE(info->messages)); return IRQ_HANDLED; } |