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

From: John Paul Adrian Glaubitz

Date: Mon Sep 28 2026 - 09:51:33 EST


Hi Karl,

On Mon, 2026-09-28 at 08:07 +0200, Karl Mehltretter wrote:
> 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
>

That patch indeed fixes the build issue and the ICE and I can finally
build a kernel image using Toybox for my J2 board again. Let me see
if the kernel also boots.

Unless your patch is identical to Florian's, you can post yours later.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913