All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl Mehltretter <kmehltretter@gmail.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Thomas Gleixner <tglx@kernel.org>, Marc Zyngier <maz@kernel.org>,
	 Radu Rendec <radu@rendec.net>,
	Artur Rojek <contact@artur-rojek.eu>,
	 Rich Felker <dalias@libc.org>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/jcore-aic: Fix lost IPIs on SMP
Date: Mon, 28 Sep 2026 08:07:20 +0200	[thread overview]
Message-ID: <aroDuGZBLsAw7tMS@gmail.com> (raw)
In-Reply-To: <92e110eef6dac0c6ddceb6ddda1658aeeaf1f0ec.camel@physik.fu-berlin.de>

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
 

  reply	other threads:[~2026-09-28  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  3:54 [PATCH] irqchip/jcore-aic: Fix lost IPIs on SMP Karl Mehltretter
2026-09-28  5:57 ` John Paul Adrian Glaubitz
2026-09-28  6:07   ` Karl Mehltretter [this message]
2026-09-28  6:42     ` John Paul Adrian Glaubitz
2026-09-28 13:40     ` John Paul Adrian Glaubitz
2026-09-28 14:04 ` John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aroDuGZBLsAw7tMS@gmail.com \
    --to=kmehltretter@gmail.com \
    --cc=contact@artur-rojek.eu \
    --cc=dalias@libc.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=radu@rendec.net \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.