Re: [PATCH 1/3] powerpc: Add support for 128-bit cmpxchg

From: Nathan Chancellor

Date: Wed Nov 25 2026 - 15:45:06 EST


On Wed, Nov 25, 2026 at 11:10:22PM +0530, Nysal Jan K.A. wrote:
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index c3b6cd655606..79cda056dfc4 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -15,6 +15,9 @@ config CC_HAS_PCREL
> # do pcrel yet.
> def_bool PPC64 && CC_IS_GCC && $(cc-option, -mcpu=power10 -mpcrel)
>
> +config CC_HAS_PTI_MODE_VAR_ATTR
> + def_bool $(success,echo 'void foo(void) { unsigned __int128 u128 __attribute__((__mode__(PTI))); }' | $(CC) -x c - -c -o /dev/null)

Please use '$(CC) $(CLANG_FLAGS)' so that this works if clang adds
support for this, which will depend on the target information in
CLANG_FLAGS.

Also, consider following the recently added guidance to
scripts/Kconfig.toolchain and add some information about when this check
can go away:

https://git.kernel.org/kbuild/c/c285fe817a92f9c747931134f468d2aefeae6bce

It would probably be something like

# gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106895 - first fixed in 17.0.0, backported in 16.2.0, 15.4.0, and 14.5.0
# clang: not supported - <bug link like Nick requested>

--
Cheers,
Nathan