Re: [PATCH] irqchip/jcore-aic: Fix lost IPIs on SMP

From: Karl Mehltretter

Date: Mon Sep 28 2026 - 02:08:05 EST


On Mon, Sep 28, 2026 at 07:57:27AM +0100, John Paul Adrian Glaubitz wrote:
> Can you tell me what toolchain you used to build the kernel for J2?
>
> Last time I tried to use the one provided by Rob Landley, the build
> failed due to an internal compiler error so I couldn't actually build
> a kernel to test it on my J2 Turtleboard.
>

Hi Adrian,

musl.cc's sh2eb-linux-muslfdpic toolchain (GCC 11.2.1, binutils 2.37):

https://musl.cc/sh2eb-linux-muslfdpic-cross.tgz

Your ICE is probably the one in kernel/nstree.c. Since listns() went in
(v6.19), every GCC I tried ICEs there with j2_defconfig. The 64-bit
put_user() asm prints %T (address + 4) of an "m" operand, and GCC can
pick an indexed address that cannot be offset. The asm needs "o".
GCC should still error out instead of crashing, so I filed a GCC bug
too:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127639

Fix below, formal patch follows. With it, j2_defconfig with SMP=y
builds fine with the musl.cc toolchain.

Would be great if you could test on your Turtleboard!

Karl

-- >8 --
diff --git a/arch/sh/include/asm/uaccess_32.h b/arch/sh/include/asm/uaccess_32.h
index 5d7ddc092afd7..879d262489219 100644
--- a/arch/sh/include/asm/uaccess_32.h
+++ b/arch/sh/include/asm/uaccess_32.h
@@ -92,7 +92,7 @@ __asm__ __volatile__( \
".long 1b + 2, 3b\n\t" \
".previous" \
:"=&r" (err), "=&r" (x) \
- :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+ : "o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
#else
#define __get_user_u64(x, addr, err) \
({ \
@@ -116,7 +116,7 @@ __asm__ __volatile__( \
".long 1b + 2, 3b\n\t" \
".previous" \
:"=&r" (err), "=&r" (x) \
- :"m" (__m(addr)), "i" (-EFAULT), "0" (err)); })
+ : "o" (__m(addr)), "i" (-EFAULT), "0" (err)); })
#endif

#define __put_user_size(x,ptr,size,retval) \
@@ -196,7 +196,7 @@ __asm__ __volatile__( \
".long 1b, 3b\n\t" \
".previous" \
: "=r" (retval) \
- : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+ : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
: "memory"); })
#else
#define __put_user_u64(val,addr,retval) \
@@ -218,7 +218,7 @@ __asm__ __volatile__( \
".long 1b, 3b\n\t" \
".previous" \
: "=r" (retval) \
- : "r" (val), "m" (__m(addr)), "i" (-EFAULT), "0" (retval) \
+ : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
: "memory"); })
#endif