Re: [PATCH v3] ring-buffer: Remove 32bit timestamp logic

From: Linus Torvalds
Date: Thu Dec 14 2023 - 15:30:51 EST


On Thu, 14 Dec 2023 at 12:18, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> For this issue of the 64bit cmpxchg, is there any config that works for any
> arch that do not have a safe 64-bit cmpxchg? At least for 486, is the
> second half of the if condition reasonable?
>
> if (IS_ENABLED(CONFIG_X86_32) && !IS_ENABLED(CONFIG_X86_CMPXCHG64)) {
> if (unlikely(in_nmi()))
> return NULL;
> }

No.

Read my email. Don't do random x86-centric things. We have that

#ifndef system_has_cmpxchg64
#define system_has_cmpxchg64() false
#endif

which should work.

NOTE! The above is for 32-bit architectures only! For 64-bit ones
either just use cmpxchg directly. And if you need a 128-bit one,
there's system_has_cmpxchg128...

Linus