* [PATCH] ARM: disable broken eBPF JIT on the Risc PC
@ 2026-05-18 1:49 Ethan Nelson-Moore
2026-05-25 8:18 ` Linus Walleij
2026-06-14 11:58 ` David Laight
0 siblings, 2 replies; 8+ messages in thread
From: Ethan Nelson-Moore @ 2026-05-18 1:49 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel
Cc: Ethan Nelson-Moore, stable, Russell King, Russell King (Oracle),
Arnd Bergmann, Linus Walleij, Kees Cook, Nathan Chancellor,
Thomas Weissschuh, Peter Zijlstra, Shubham Bansal,
David S. Miller
The eBPF JIT unconditionally generates ldrh/strh instructions, which do
not function correctly on the Risc PC because its bus is unable to
signal half-word accesses. Work around this issue by disabling the eBPF
JIT when building for ARMv3 (the Risc PC is the only currently
supported ARMv3 machine).
Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1155c78bb6aa..8185d013e5d1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -98,7 +98,7 @@ config ARM
select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE
select HAVE_ARM_SMCCC if CPU_V7
- select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
+ select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 && !CPU_32v3
select HAVE_CONTEXT_TRACKING_USER
select HAVE_C_RECORDMCOUNT
select HAVE_BUILDTIME_MCOUNT_SORT
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-05-18 1:49 [PATCH] ARM: disable broken eBPF JIT on the Risc PC Ethan Nelson-Moore
@ 2026-05-25 8:18 ` Linus Walleij
2026-06-14 1:50 ` Ethan Nelson-Moore
2026-06-14 11:58 ` David Laight
1 sibling, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2026-05-25 8:18 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: linux-arm-kernel, linux-kernel, stable, Russell King,
Russell King (Oracle), Arnd Bergmann, Kees Cook,
Nathan Chancellor, Thomas Weissschuh, Peter Zijlstra,
Shubham Bansal, David S. Miller
On Mon, May 18, 2026 at 3:49 AM Ethan Nelson-Moore
<enelsonmoore@gmail.com> wrote:
> The eBPF JIT unconditionally generates ldrh/strh instructions, which do
> not function correctly on the Risc PC because its bus is unable to
> signal half-word accesses. Work around this issue by disabling the eBPF
> JIT when building for ARMv3 (the Risc PC is the only currently
> supported ARMv3 machine).
>
> Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Looks correct to me.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Please put this into Russell's patch tracker!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-05-25 8:18 ` Linus Walleij
@ 2026-06-14 1:50 ` Ethan Nelson-Moore
2026-06-14 22:14 ` Russell King (Oracle)
0 siblings, 1 reply; 8+ messages in thread
From: Ethan Nelson-Moore @ 2026-06-14 1:50 UTC (permalink / raw)
To: Linus Walleij
Cc: linux-arm-kernel, linux-kernel, stable, Russell King,
Russell King (Oracle), Arnd Bergmann, Kees Cook,
Nathan Chancellor, Thomas Weissschuh, Peter Zijlstra,
Shubham Bansal, David S. Miller
On Mon, May 25, 2026 at 1:18 AM Linus Walleij <linusw@kernel.org> wrote:
> Looks correct to me.
> Reviewed-by: Linus Walleij <linusw@kernel.org>
>
> Please put this into Russell's patch tracker!
Done!
https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9477/1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-05-18 1:49 [PATCH] ARM: disable broken eBPF JIT on the Risc PC Ethan Nelson-Moore
2026-05-25 8:18 ` Linus Walleij
@ 2026-06-14 11:58 ` David Laight
2026-06-14 21:44 ` Ethan Nelson-Moore
1 sibling, 1 reply; 8+ messages in thread
From: David Laight @ 2026-06-14 11:58 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: linux-arm-kernel, linux-kernel, stable, Russell King,
Russell King (Oracle), Arnd Bergmann, Linus Walleij, Kees Cook,
Nathan Chancellor, Thomas Weissschuh, Peter Zijlstra,
Shubham Bansal, David S. Miller
On Sun, 17 May 2026 18:49:17 -0700
Ethan Nelson-Moore <enelsonmoore@gmail.com> wrote:
> The eBPF JIT unconditionally generates ldrh/strh instructions, which do
> not function correctly on the Risc PC because its bus is unable to
> signal half-word accesses. Work around this issue by disabling the eBPF
> JIT when building for ARMv3 (the Risc PC is the only currently
> supported ARMv3 machine).
Isn't it more the case that the ldrh/strh instructions were added for armv4.
Whether the bus supports 16bit accesses is entirely different.
I'm guessing that WRITE_ONCE() gets implemented as two 8-bit writes and
the code 'just hopes' than an ISR won't care and won't do an update.
David
>
> Fixes: 39c13c204bb1 ("arm: eBPF JIT compiler")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
> ---
> arch/arm/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 1155c78bb6aa..8185d013e5d1 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -98,7 +98,7 @@ config ARM
> select HAVE_ARCH_TRACEHOOK
> select HAVE_ARCH_TRANSPARENT_HUGEPAGE if ARM_LPAE
> select HAVE_ARM_SMCCC if CPU_V7
> - select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
> + select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 && !CPU_32v3
> select HAVE_CONTEXT_TRACKING_USER
> select HAVE_C_RECORDMCOUNT
> select HAVE_BUILDTIME_MCOUNT_SORT
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-06-14 11:58 ` David Laight
@ 2026-06-14 21:44 ` Ethan Nelson-Moore
2026-06-15 8:56 ` David Laight
0 siblings, 1 reply; 8+ messages in thread
From: Ethan Nelson-Moore @ 2026-06-14 21:44 UTC (permalink / raw)
To: David Laight
Cc: linux-arm-kernel, linux-kernel, stable, Russell King,
Russell King (Oracle), Arnd Bergmann, Linus Walleij, Kees Cook,
Nathan Chancellor, Thomas Weissschuh, Peter Zijlstra,
Shubham Bansal, David S. Miller
Hi, David,
On Sun, Jun 14, 2026 at 4:58 AM David Laight
<david.laight.linux@gmail.com> wrote:
> Isn't it more the case that the ldrh/strh instructions were added for armv4.
> Whether the bus supports 16bit accesses is entirely different.
No, it is in fact the bus. While the Risc PC initially shipped with
ARMv3 CPUs, which the kernel no longer supports, it was later upgraded
to an ARMv4 StrongARM CPU. However, its bus was designed for ARMv3
CPUs and has no way to represent a half-word access to memory. This
means that ldrh/strh will execute (because the CPU supports them) but
do not function as intended.
Ethan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-06-14 1:50 ` Ethan Nelson-Moore
@ 2026-06-14 22:14 ` Russell King (Oracle)
2026-06-14 22:41 ` Ethan Nelson-Moore
0 siblings, 1 reply; 8+ messages in thread
From: Russell King (Oracle) @ 2026-06-14 22:14 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: Linus Walleij, linux-arm-kernel, linux-kernel, stable,
Arnd Bergmann, Kees Cook, Nathan Chancellor, Thomas Weissschuh,
Peter Zijlstra, Shubham Bansal, David S. Miller
On Sat, Jun 13, 2026 at 06:50:40PM -0700, Ethan Nelson-Moore wrote:
> On Mon, May 25, 2026 at 1:18 AM Linus Walleij <linusw@kernel.org> wrote:
> > Looks correct to me.
> > Reviewed-by: Linus Walleij <linusw@kernel.org>
> >
> > Please put this into Russell's patch tracker!
>
> Done!
>
> https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9477/1
Should be s/arm\./arm/
Also, you can use:
Link: https://lore.kernel.org/all/CAD++jL=0qYGoygUwGEXQL7C_ROnC7kfpRv8RA+H5tNWwYu+pQA@mail.gmail.com/
in the attributions in the commit message to indicate where more
patch context can be found.
Lastly, too late for v7.1 as a fix, I already sent the pull request
for that, sorry.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-06-14 22:14 ` Russell King (Oracle)
@ 2026-06-14 22:41 ` Ethan Nelson-Moore
0 siblings, 0 replies; 8+ messages in thread
From: Ethan Nelson-Moore @ 2026-06-14 22:41 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Linus Walleij, linux-arm-kernel, linux-kernel, stable,
Arnd Bergmann, Kees Cook, Nathan Chancellor, Thomas Weissschuh,
Peter Zijlstra, Shubham Bansal, David S. Miller
Hi, Russell,
On Sun, Jun 14, 2026 at 3:14 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
> > https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=9477/1
>
> Should be s/arm\./arm/
Got it. Would it make sense to make the domain with the dot 301
redirect to the same URL at the one without the dot? Right now, Google
is indexing both, and this would remedy that.
> Also, you can use:
>
> Link: https://lore.kernel.org/all/CAD++jL=0qYGoygUwGEXQL7C_ROnC7kfpRv8RA+H5tNWwYu+pQA@mail.gmail.com/
>
> in the attributions in the commit message to indicate where more
> patch context can be found.
Thanks. I knew that but didn't think of it at the time I submitted.
> Lastly, too late for v7.1 as a fix, I already sent the pull request
> for that, sorry.
That's okay. It's not a particularly high priority :p
Ethan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] ARM: disable broken eBPF JIT on the Risc PC
2026-06-14 21:44 ` Ethan Nelson-Moore
@ 2026-06-15 8:56 ` David Laight
0 siblings, 0 replies; 8+ messages in thread
From: David Laight @ 2026-06-15 8:56 UTC (permalink / raw)
To: Ethan Nelson-Moore
Cc: linux-arm-kernel, linux-kernel, stable, Russell King,
Russell King (Oracle), Arnd Bergmann, Linus Walleij, Kees Cook,
Nathan Chancellor, Thomas Weissschuh, Peter Zijlstra,
Shubham Bansal, David S. Miller
On Sun, 14 Jun 2026 14:44:38 -0700
Ethan Nelson-Moore <enelsonmoore@gmail.com> wrote:
> Hi, David,
>
> On Sun, Jun 14, 2026 at 4:58 AM David Laight
> <david.laight.linux@gmail.com> wrote:
> > Isn't it more the case that the ldrh/strh instructions were added for armv4.
> > Whether the bus supports 16bit accesses is entirely different.
>
> No, it is in fact the bus. While the Risc PC initially shipped with
> ARMv3 CPUs, which the kernel no longer supports, it was later upgraded
> to an ARMv4 StrongARM CPU. However, its bus was designed for ARMv3
> CPUs and has no way to represent a half-word access to memory. This
> means that ldrh/strh will execute (because the CPU supports them) but
> do not function as intended.
Ok, so they work fine for cached accesses.
The only issue will be with uncached ones?
(Or do I remember the strongarm having a write-through cache?)
It just seems odd because byte writes are usually handled with four
byte-enable lines; so the targets support all 16 combinations even
though a cpu will (normally) only be able to generate 8 of them.
David
>
> Ethan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-06-15 8:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 1:49 [PATCH] ARM: disable broken eBPF JIT on the Risc PC Ethan Nelson-Moore
2026-05-25 8:18 ` Linus Walleij
2026-06-14 1:50 ` Ethan Nelson-Moore
2026-06-14 22:14 ` Russell King (Oracle)
2026-06-14 22:41 ` Ethan Nelson-Moore
2026-06-14 11:58 ` David Laight
2026-06-14 21:44 ` Ethan Nelson-Moore
2026-06-15 8:56 ` David Laight
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox