Re: [RFC PATCH 09/10] powerpc: snapshot thread flags

From: Michael Ellerman
Date: Tue Jun 15 2021 - 09:19:06 EST

Mark Rutland <mark.rutland@xxxxxxx> writes:
> Some thread flags can be set remotely, and so even when IRQs are
> disabled, the flags can change under our feet. Generally this is
> unlikely to cause a problem in practice, but it is somewhat unsound, and
> KCSAN will legitimately warn that there is a data race.
> To avoid such issues, we should snapshot the flags prior to using them.
> Let's use the new helpers to do so on powerpc.
> Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> ---
> arch/powerpc/kernel/interrupt.c | 16 ++++++++--------
> arch/powerpc/kernel/ptrace/ptrace.c | 3 +--
> 2 files changed, 9 insertions(+), 10 deletions(-)

This looks good.

Acked-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> (powerpc)

But, it clashes terribly with a series I'm planning to take for v5.14
that reworks our interrupt return code.

So if you're also targeting v5.14 then it might be best to drop this
patch from the series, and we can do the conversion later.