Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr()

From: Peter Zijlstra
Date: Thu Oct 19 2023 - 05:09:46 EST


On Wed, Oct 18, 2023 at 03:40:05PM -0700, Linus Torvalds wrote:
> On Wed, 18 Oct 2023 at 14:40, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> >
> > The ones in "raw" form are not IRQ safe and these are implemented
> > without volatile qualifier.
>
> You are misreading it.
>
> Both *are* irq safe - on x86.

Stronger, x86 arch code very much relies on them being NMI-safe. Which
makes the generic implementation insufficient.

They *must* be single RmW instructions on x86.