From: Michael Ellerman <mpe@xxxxxxxxxxxxxx> commit 17c743b9da9e0d073ff19fd5313f521744514939 upstream. Building the sigaltstack test with GCC on 64-bit powerpc errors with: gcc -Wall sas.c -o /home/michael/linux/.build/kselftest/sigaltstack/sas In file included from sas.c:23: current_stack_pointer.h:22:2: error: #error "implement current_stack_pointer equivalent" 22 | #error "implement current_stack_pointer equivalent" | ^~~~~ sas.c: In function ‘my_usr1’: sas.c:50:13: error: ‘sp’ undeclared (first use in this function); did you mean ‘p’? 50 | if (sp < (unsigned long)sstack || | ^~ This happens because GCC doesn't define __ppc__ for 64-bit builds, only 32-bit builds. Instead use __powerpc__ to detect powerpc builds, which is defined by clang and GCC for 64-bit and 32-bit builds. Fixes: 05107edc9101 ("selftests: sigaltstack: fix -Wuninitialized") Cc: stable@xxxxxxxxxxxxxxx # v6.3+ Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Link: https://msgid.link/20240520062647.688667-1-mpe@xxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/sigaltstack/current_stack_pointer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/selftests/sigaltstack/current_stack_pointer.h +++ b/tools/testing/selftests/sigaltstack/current_stack_pointer.h @@ -8,7 +8,7 @@ register unsigned long sp asm("sp"); register unsigned long sp asm("esp"); #elif __loongarch64 register unsigned long sp asm("$sp"); -#elif __ppc__ +#elif __powerpc__ register unsigned long sp asm("r1"); #elif __s390x__ register unsigned long sp asm("%15"); Patches currently in stable-queue which might be from mpe@xxxxxxxxxxxxxx are queue-6.10/selftests-sigaltstack-fix-ppc64-gcc-build.patch queue-6.10/powerpc-kexec_file-fix-cpus-node-update-to-fdt.patch queue-6.10/kvm-ppc-book3s-hv-nestedv2-add-dpdes-support-in-helper-library-for-guest-state-buffer.patch queue-6.10/kvm-ppc-book3s-hv-nestedv2-fix-doorbell-emulation.patch queue-6.10/macintosh-therm_windtunnel-fix-module-unload.patch queue-6.10/powerpc-xmon-fix-disassembly-cpu-feature-checks.patch queue-6.10/powerpc-8xx-fix-size-given-to-set_huge_pte_at.patch queue-6.10/kvm-ppc-book3s-hv-fix-the-get_one_reg-of-sdar.patch queue-6.10/kvm-ppc-book3s-hv-fix-the-set_one_reg-for-mmcr3.patch queue-6.10/powerpc-prom-add-cpu-info-to-hardware-description-st.patch