powerpc: Mark [h]ssr_valid accesses in check_return_regs_valid
authorRohan McLure <rmclure@linux.ibm.com>
Wed, 10 May 2023 03:31:10 +0000 (13:31 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Jun 2023 05:13:57 +0000 (15:13 +1000)
commitbe286b8637d417a7d7eb25dc3a509c10d0afef66
tree8478d86bc6c86a05ebc435ecfbdd1590fabf6832
parent6f3136326ee47ae2dd5dac9306c9b08ccbc7e81e
powerpc: Mark [h]ssr_valid accesses in check_return_regs_valid

Checks to see if the [H]SRR registers have been clobbered by (soft)
NMI interrupts imply the possibility for a data race on the
[h]srr_valid entries in the PACA. Annotate accesses to these fields with
READ_ONCE, removing the need for the barrier.

The diagnostic can use plain-access reads and writes, but annotate with
data_race.

Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230510033117.1395895-5-rmclure@linux.ibm.com
arch/powerpc/include/asm/ptrace.h
arch/powerpc/kernel/interrupt.c