FAILED: patch "[PATCH] ARM: 9477/1: Disable broken eBPF JIT on the Risc PC" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 7e8ee82e69fde9d589272ec5e6f702358903be1f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090326-curtsy-rocket-6c6d@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7e8ee82e69fde9d589272ec5e6f702358903be1f Mon Sep 17 00:00:00 2001
From: Ethan Nelson-Moore <[email protected]>
Date: Sun, 14 Jun 2026 02:45:38 +0100
Subject: [PATCH] ARM: 9477/1: Disable broken eBPF JIT on the Risc PC
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 machine whose kernel is built for ARMv3).
Comments from Ethan Nelson-Moore:
From LKML: https://lore.kernel.org/all/CAD++jL=0qYGoygUwGEXQL7C_ROnC7kfpRv8RA+H5tNWwYu+pQA@mail.gmail.com/
The commit message has been updated slightly relative to the version on LKML to clarify that the Risc PC is not actually ARMv3.
arch/arm/Kconfig +1 -1
@@ -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
Sasha Levin
maintainerPATCH 1/5 context_tracking: Add a note about noinstr VS unsafe context tracking functions
From: Frederic Weisbecker <[email protected]>
[ Upstream commit f67671baadf6dbae8eca46cb95e85b762e462b2b ]
Some context tracking functions enter or exit into/from RCU idle mode while using trace-able and lockdep-aware IRQs (un-)masking. As a result those functions can't get tagged as noinstr. This is unlikely to be fixed since these are obsolete APIs. Drop a note about this matter.
[ paulmck: Apply Peter Zijlstra feedback. ]
Stable-dep-of: 7e8ee82e69fd ("ARM: 9477/1: Disable broken eBPF JIT on the Risc PC")
--- kernel/context_tracking.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
kernel/context_tracking.c +34 -0
@@ -103,6 +103,15 @@ void noinstr __context_tracking_enter(enum ctx_state state) }EXPORT_SYMBOL_GPL (__context_tracking_enter); +/* +* OBSOLETE: +* This function should be noinstr but the below local_irq_restore() is +* unsafe because it involves illegal RCU uses through tracing and lockdep. +* This is unlikely to be fixed as this function is obsolete. The preferred +* way is to call __context_tracking_enter() through user_enter_irqoff() +* or context_tracking_guest_enter(). It should be the arch entry code +* responsibility to call into context tracking with IRQs disabled. +*/ void context_tracking_enter (enum ctx_state state) {unsigned long flags;
@@ -125,6 +134,14 @@ void context_tracking_enter(enum ctx_state state)NOKPROBE_SYMBOL (context_tracking_enter);EXPORT_SYMBOL_GPL (context_tracking_enter); +/* +* OBSOLETE: +* This function should be noinstr but it unsafely calls local_irq_restore(), +* involving illegal RCU uses through tracing and lockdep. +* This is unlikely to be fixed as this function is obsolete. The preferred +* way is to call user_enter_irqoff(). It should be the arch entry code +* responsibility to call into context tracking with IRQs disabled. +*/ void context_tracking_user_enter (void ) {user_enter ();
@@ -168,6 +185,15 @@ void noinstr __context_tracking_exit(enum ctx_state state) }EXPORT_SYMBOL_GPL (__context_tracking_exit); +/* +* OBSOLETE: +* This function should be noinstr but the below local_irq_save() is +* unsafe because it involves illegal RCU uses through tracing and lockdep. +* This is unlikely to be fixed as this function is obsolete. The preferred +* way is to call __context_tracking_exit() through user_exit_irqoff() +* or context_tracking_guest_exit(). It should be the arch entry code +* responsibility to call into context tracking with IRQs disabled. +*/ void context_tracking_exit (enum ctx_state state) {unsigned long flags;
@@ -182,6 +208,14 @@ void context_tracking_exit(enum ctx_state state)NOKPROBE_SYMBOL (context_tracking_exit);EXPORT_SYMBOL_GPL (context_tracking_exit); +/* +* OBSOLETE: +* This function should be noinstr but it unsafely calls local_irq_save(), +* involving illegal RCU uses through tracing and lockdep. This is unlikely +* to be fixed as this function is obsolete. The preferred way is to call +* user_exit_irqoff(). It should be the arch entry code responsibility to +* call into context tracking with IRQs disabled. +*/ void context_tracking_user_exit (void ) {user_exit ();
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/5 context_tracking: Rename context_tracking_user_enter/exit() to user_enter/exit_callable()
From: Frederic Weisbecker <[email protected]>
[ Upstream commit f163f0302ab69722c052519f4014814bf10026a9 ]
context_tracking_user_enter() and context_tracking_user_exit() are ASM callable versions of user_enter() and user_exit() for architectures that didn't manage to check the context tracking static key from ASM. Change those function names to better reflect their purpose.
[ frederic: Apply Max Filippov feedback. ]
[ sashal: Reduced backport -- upstream f163f0302ab69 touches 6 file(s), this
backport carries 5. Not backported here:
arch/xtensa/kernel/entry.S
This note is generated from the file lists only; see the resolution record for the reasoning. ]
Stable-dep-of: 7e8ee82e69fd ("ARM: 9477/1: Disable broken eBPF JIT on the Risc PC")
--- arch/arm/kernel/entry-header.S | 8 ++++---- arch/csky/kernel/entry.S | 4 ++-- arch/riscv/kernel/entry.S | 6 +++--- include/linux/context_tracking.h | 4 ++-- kernel/context_tracking.c | 28 +++++++++++++++++----------- 5 files changed, 28 insertions(+), 22 deletions(-)
arch/arm/kernel/entry-header.S +4 -4
@@ -356,10 +356,10 @@ #ifdef CONFIG_CONTEXT_TRACKING .if \save stmdb sp!, {r0-r3, ip, lr} - bl context_tracking_user_exit + bl user_exit_callable ldmia sp!, {r0-r3, ip, lr} .else - bl context_tracking_user_exit + bl user_exit_callable .endif #endif .endm
@@ -368,10 +368,10 @@ #ifdef CONFIG_CONTEXT_TRACKING .if \save stmdb sp!, {r0-r3, ip, lr} - bl context_tracking_user_enter + bl user_enter_callable ldmia sp!, {r0-r3, ip, lr} .else - bl context_tracking_user_enter + bl user_enter_callable .endif #endif .endm
arch/csky/kernel/entry.S +2 -2
@@ -28,7 +28,7 @@ mfcr a0, epsr btsti a0, 31 bt 1f - jbsr context_tracking_user_exit + jbsr user_exit_callable ldw a0, (sp, LSAVE_A0) ldw a1, (sp, LSAVE_A1) ldw a2, (sp, LSAVE_A2)
@@ -258,7 +258,7 @@ ret_from_exception: cmpnei r10, 0 bt exit_work #ifdef CONFIG_CONTEXT_TRACKING - jbsr context_tracking_user_enter + jbsr user_enter_callable #endif 1: #ifdef CONFIG_PREEMPTION
arch/riscv/kernel/entry.S +3 -3
@@ -102,11 +102,11 @@ _save_context: #endif #ifdef CONFIG_CONTEXT_TRACKING - /* If previous state is in user mode, call context_tracking_user_exit. */ + /* If previous state is in user mode, call user_exit_callable(). */ li a0, SR_PP and a0, s1, a0 bnez a0, skip_context_tracking - call context_tracking_user_exit + call user_exit_callable skip_context_tracking: #endif
@@ -240,7 +240,7 @@ resume_userspace: bnez s1, work_pending #ifdef CONFIG_CONTEXT_TRACKING - call context_tracking_user_enter + call user_enter_callable #endif /* Save unwound kernel stack pointer in thread_info */
include/linux/context_tracking.h +2 -2
@@ -19,8 +19,8 @@ extern void __context_tracking_exit(enum ctx_state state);extern void context_tracking_enter (enum ctx_state state);extern void context_tracking_exit (enum ctx_state state); -extern void context_tracking_user_enter (void ); -extern void context_tracking_user_exit (void ); +extern void user_enter_callable (void ); +extern void user_exit_callable (void );static inline void user_enter (void ) {
kernel/context_tracking.c +17 -11
@@ -134,19 +134,22 @@ void context_tracking_enter(enum ctx_state state)NOKPROBE_SYMBOL (context_tracking_enter);EXPORT_SYMBOL_GPL (context_tracking_enter); -/* -* OBSOLETE: -* This function should be noinstr but it unsafely calls local_irq_restore(), -* involving illegal RCU uses through tracing and lockdep. +/** +* user_enter_callable() - Unfortunate ASM callable version of user_enter() for +* archs that didn't manage to check the context tracking +* static key from low level code. +* +* This OBSOLETE function should be noinstr but it unsafely calls +* local_irq_restore(), involving illegal RCU uses through tracing and lockdep. * This is unlikely to be fixed as this function is obsolete. The preferred * way is to call user_enter_irqoff(). It should be the arch entry code * responsibility to call into context tracking with IRQs disabled. */ -void context_tracking_user_enter (void ) +void user_enter_callable (void ) {user_enter (); } -NOKPROBE_SYMBOL (context_tracking_user_enter); +NOKPROBE_SYMBOL (user_enter_callable);/** * context_tracking_exit - Inform the context tracking that the CPU is
@@ -208,19 +211,22 @@ void context_tracking_exit(enum ctx_state state)NOKPROBE_SYMBOL (context_tracking_exit);EXPORT_SYMBOL_GPL (context_tracking_exit); -/* -* OBSOLETE: -* This function should be noinstr but it unsafely calls local_irq_save(), +/** +* user_exit_callable() - Unfortunate ASM callable version of user_exit() for +* archs that didn't manage to check the context tracking +* static key from low level code. +* +* This OBSOLETE function should be noinstr but it unsafely calls local_irq_save(), * involving illegal RCU uses through tracing and lockdep. This is unlikely * to be fixed as this function is obsolete. The preferred way is to call * user_exit_irqoff(). It should be the arch entry code responsibility to * call into context tracking with IRQs disabled. */ -void context_tracking_user_exit (void ) +void user_exit_callable (void ) {user_exit (); } -NOKPROBE_SYMBOL (context_tracking_user_exit); +NOKPROBE_SYMBOL (user_exit_callable);void __init context_tracking_cpu_set (int cpu) {
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 3/5 context_tracking: Rename context_tracking_cpu_set() to ct_cpu_track_user()
In reply to Sasha LevinFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit 2a0aafce963dab996b843f6cdb49237b0ae4a118 ]
context_tracking_cpu_set() is called in order to tell a CPU to track user/kernel transitions. Since context tracking is going to expand in to also track transitions from/to idle/IRQ/NMIs, the scope of this function name becomes too broad and needs to be made more specific. Also shorten the prefix to align with the new namespace.
Stable-dep-of: 7e8ee82e69fd ("ARM: 9477/1: Disable broken eBPF JIT on the Risc PC")
--- include/linux/context_tracking.h | 2 +- kernel/context_tracking.c | 4 ++-- kernel/time/tick-sched.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
include/linux/context_tracking.h +1 -1
@@ -11,7 +11,7 @@#ifdef CONFIG_CONTEXT_TRACKING -extern void context_tracking_cpu_set (int cpu); +extern void ct_cpu_track_user (int cpu);/* Called with interrupts disabled. */ extern void __context_tracking_enter (enum ctx_state state);
kernel/context_tracking.c +2 -2
@@ -228,7 +228,7 @@ void user_exit_callable(void) }NOKPROBE_SYMBOL (user_exit_callable); -void __init context_tracking_cpu_set (int cpu) +void __init ct_cpu_track_user (int cpu) {static __initdata bool initialized = false;
@@ -258,6 +258,6 @@ void __init context_tracking_init(void)int cpu;for_each_possible_cpu (cpu) - context_tracking_cpu_set(cpu); + ct_cpu_track_user(cpu); }#endif
kernel/time/tick-sched.c +1 -1
@@ -525,7 +525,7 @@ void __init tick_nohz_init(void) }for_each_cpu (cpu, tick_nohz_full_mask) -context_tracking_cpu_set (cpu); +ct_cpu_track_user (cpu); ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "kernel/nohz:predown", NULL,
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 4/5 context_tracking: Split user tracking Kconfig
In reply to Sasha LevinFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit 24a9c54182b3758801b8ca6c8c237cc2ff654732 ]
Context tracking is going to be used not only to track user transitions but also idle/IRQs/NMIs. The user tracking part will then become a separate feature. Prepare Kconfig for that.
[ frederic: Apply Max Filippov feedback. ]
[ sashal: Reduced backport -- upstream 24a9c54182b37 touches 25 file(s), this
backport carries 23. Not backported here:
arch/loongarch/Kconfig
arch/xtensa/Kconfig
arch/xtensa/kernel/entry.S
This note is generated from the file lists only; see the resolution record for the reasoning. ]
Stable-dep-of: 7e8ee82e69fd ("ARM: 9477/1: Disable broken eBPF JIT on the Risc PC")
--- .../time/context-tracking/arch-support.txt | 6 ++-- arch/Kconfig | 2 +- arch/arm/Kconfig | 2 +- arch/arm/kernel/entry-common.S | 4 +-- arch/arm/kernel/entry-header.S | 4 +-- arch/arm64/Kconfig | 2 +- arch/arm64/kernel/entry.S | 4 +-- arch/csky/Kconfig | 2 +- arch/csky/kernel/entry.S | 4 +-- arch/mips/Kconfig | 2 +- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/context_tracking.h | 2 +- arch/riscv/Kconfig | 2 +- arch/riscv/kernel/entry.S | 6 ++-- arch/sparc/Kconfig | 2 +- arch/sparc/kernel/rtrap_64.S | 2 +- arch/x86/Kconfig | 2 +- include/linux/context_tracking.h | 8 ++--- include/linux/context_tracking_state.h | 4 +-- init/Kconfig | 4 +-- kernel/context_tracking.c | 6 +++- kernel/sched/core.c | 2 +- kernel/time/Kconfig | 31 ++++++++++++------- 23 files changed, 59 insertions(+), 46 deletions(-)
Documentation/features/time/context-tracking/arch-support.txt +3 -3
@@ -1,7 +1,7 @@ # -# Feature name: context-tracking -# Kconfig: HAVE_CONTEXT_TRACKING -# description: arch supports context tracking for NO_HZ_FULL +# Feature name: user-context-tracking +# Kconfig: HAVE_CONTEXT_TRACKING_USER +# description: arch supports user context tracking for NO_HZ_FULL # ----------------------- | arch |status|
arch/Kconfig +1 -1
@@ -634,7 +634,7 @@ config HAVE_ARCH_WITHIN_STACK_FRAMES and similar) by implementing an inline arch_within_stack_frames(), which is used by CONFIG_HARDENED_USERCOPY. -config HAVE_CONTEXT_TRACKING +config HAVE_CONTEXT_TRACKING_USER bool help Provide kernel/user boundaries probes necessary for subsystems
arch/arm/Kconfig +1 -1
@@ -76,7 +76,7 @@ config ARM select HAVE_ARCH_TRACEHOOK select HAVE_ARM_SMCCC if CPU_V7 select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32 - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_C_RECORDMCOUNT select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL select HAVE_DMA_CONTIGUOUS if MMU
arch/arm/kernel/entry-common.S +2 -2
@@ -26,7 +26,7 @@ #include "entry-header.S" saved_psr .req r8 -#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING) +#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING_USER) saved_pc .req r9 #define TRACE(x...) x #else
@@ -36,7 +36,7 @@ saved_pc .req lr .section .entry.text,"ax",%progbits .align 5 -#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING) || \ +#if !(IS_ENABLED(CONFIG_TRACE_IRQFLAGS) || IS_ENABLED(CONFIG_CONTEXT_TRACKING_USER) || \ IS_ENABLED(CONFIG_DEBUG_RSEQ)) /* * This is the fast syscall return path. We do as little as possible here,
arch/arm/kernel/entry-header.S +2 -2
@@ -353,7 +353,7 @@ * between user and kernel mode. */ .macro ct_user_exit, save = 1 -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER .if \save stmdb sp!, {r0-r3, ip, lr} bl user_exit_callable
@@ -365,7 +365,7 @@ .endm .macro ct_user_enter, save = 1 -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER .if \save stmdb sp!, {r0-r3, ip, lr} bl user_enter_callable
arch/arm64/Kconfig +1 -1
@@ -152,7 +152,7 @@ config ARM64 select HAVE_C_RECORDMCOUNT select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_DEBUG_BUGVERBOSE select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS
arch/arm64/kernel/entry.S +2 -2
@@ -34,13 +34,13 @@ * user and kernel mode. */ .macro user_exit_irqoff -#if defined(CONFIG_CONTEXT_TRACKING) || defined(CONFIG_TRACE_IRQFLAGS) +#if defined(CONFIG_CONTEXT_TRACKING_USER) || defined(CONFIG_TRACE_IRQFLAGS) bl enter_from_user_mode #endif .endm .macro user_enter_irqoff -#if defined(CONFIG_CONTEXT_TRACKING) || defined(CONFIG_TRACE_IRQFLAGS) +#if defined(CONFIG_CONTEXT_TRACKING_USER) || defined(CONFIG_TRACE_IRQFLAGS) bl exit_to_user_mode #endif .endm
arch/csky/Kconfig +1 -1
@@ -41,7 +41,7 @@ config CSKY select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_MMAP_RND_BITS select HAVE_ARCH_SECCOMP_FILTER - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_VIRT_CPU_ACCOUNTING_GEN select HAVE_DEBUG_BUGVERBOSE select HAVE_DYNAMIC_FTRACE
arch/csky/kernel/entry.S +2 -2
@@ -24,7 +24,7 @@ .endm .macro context_tracking -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER mfcr a0, epsr btsti a0, 31 bt 1f
@@ -257,7 +257,7 @@ ret_from_exception: and r10, r9 cmpnei r10, 0 bt exit_work -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER jbsr user_enter_callable #endif 1:
arch/mips/Kconfig +1 -1
@@ -51,7 +51,7 @@ config MIPS select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES select HAVE_ASM_MODVERSIONS select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_TIF_NOHZ select HAVE_C_RECORDMCOUNT select HAVE_DEBUG_KMEMLEAK
arch/powerpc/Kconfig +1 -1
@@ -193,7 +193,7 @@ config PPC select HAVE_CBPF_JIT if !PPC64 select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) select HAVE_STACKPROTECTOR if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2) - select HAVE_CONTEXT_TRACKING if PPC64 + select HAVE_CONTEXT_TRACKING_USER if PPC64 select HAVE_TIF_NOHZ if PPC64 select HAVE_DEBUG_KMEMLEAK select HAVE_DEBUG_STACKOVERFLOW
arch/powerpc/include/asm/context_tracking.h +1 -1
@@ -2,7 +2,7 @@#ifndef _ASM_POWERPC_CONTEXT_TRACKING_H#define _ASM_POWERPC_CONTEXT_TRACKING_H -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER #define SCHEDULE_USER bl schedule_user#else #define SCHEDULE_USER bl schedule
arch/riscv/Kconfig +1 -1
@@ -62,7 +62,7 @@ config RISCV select HAVE_ARCH_SECCOMP_FILTER select HAVE_ARCH_TRACEHOOK select HAVE_ASM_MODVERSIONS - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS if MMU select HAVE_EBPF_JIT if MMU
arch/riscv/kernel/entry.S +3 -3
@@ -101,7 +101,7 @@ _save_context: call __trace_hardirqs_off #endif -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER /* If previous state is in user mode, call user_exit_callable(). */ li a0, SR_PP and a0, s1, a0
@@ -164,7 +164,7 @@ handle_syscall: */ csrs CSR_STATUS, SR_IE #endif -#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING) +#if defined(CONFIG_TRACE_IRQFLAGS) || defined(CONFIG_CONTEXT_TRACKING_USER) /* Recover a0 - a7 for system calls */ REG_L a0, PT_A0(sp) REG_L a1, PT_A1(sp)
@@ -239,7 +239,7 @@ resume_userspace: andi s1, s0, _TIF_WORK_MASK bnez s1, work_pending -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER call user_enter_callable #endif
arch/sparc/Kconfig +1 -1
@@ -74,7 +74,7 @@ config SPARC64 select HAVE_DYNAMIC_FTRACE select HAVE_FTRACE_MCOUNT_RECORD select HAVE_SYSCALL_TRACEPOINTS - select HAVE_CONTEXT_TRACKING + select HAVE_CONTEXT_TRACKING_USER select HAVE_TIF_NOHZ select HAVE_DEBUG_KMEMLEAK select IOMMU_HELPER
arch/sparc/kernel/rtrap_64.S +1 -1
@@ -15,7 +15,7 @@ #include <asm/visasm.h> #include <asm/processor.h> -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER # define SCHEDULE_USER schedule_user #else # define SCHEDULE_USER schedule
arch/x86/Kconfig +1 -1
@@ -165,7 +165,7 @@ config X86 select HAVE_ASM_MODVERSIONS select HAVE_CMPXCHG_DOUBLE select HAVE_CMPXCHG_LOCAL - select HAVE_CONTEXT_TRACKING if X86_64 + select HAVE_CONTEXT_TRACKING_USER if X86_64 select HAVE_C_RECORDMCOUNT select HAVE_DEBUG_KMEMLEAK select HAVE_DMA_CONTIGUOUS
include/linux/context_tracking.h +4 -4
@@ -10,7 +10,7 @@#include <asm/ptrace.h> -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER extern void ct_cpu_track_user (int cpu);/* Called with interrupts disabled. */
@@ -90,15 +90,15 @@ static inline void user_exit_irqoff(void) { }static inline enum ctx_state exception_enter (void ) {return 0 ; }static inline void exception_exit (enum ctx_state prev_ctx) { }static inline enum ctx_state ct_state (void ) {return CONTEXT_DISABLED ; } -#endif /* !CONFIG_CONTEXT_TRACKING */ +#endif /* !CONFIG_CONTEXT_TRACKING_USER */ #define CT_WARN_ON (cond) WARN_ON(context_tracking_enabled() && (cond)) -#ifdef CONFIG_CONTEXT_TRACKING_FORCE +#ifdef CONFIG_CONTEXT_TRACKING_USER_FORCE extern void context_tracking_init (void );#else static inline void context_tracking_init (void ) { } -#endif /* CONFIG_CONTEXT_TRACKING_FORCE */ +#endif /* CONFIG_CONTEXT_TRACKING_USER_FORCE */ #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
include/linux/context_tracking_state.h +2 -2
@@ -22,7 +22,7 @@ struct context_tracking { } state; }; -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER extern struct static_key_false context_tracking_key; DECLARE_PER_CPU(struct context_tracking, context_tracking);
@@ -50,6 +50,6 @@ static inline bool context_tracking_in_user(void) { return false; }static inline bool context_tracking_enabled (void ) {return false; }static inline bool context_tracking_enabled_cpu (int cpu) {return false; }static inline bool context_tracking_enabled_this_cpu (void ) {return false; } -#endif /* CONFIG_CONTEXT_TRACKING */ +#endif /* CONFIG_CONTEXT_TRACKING_USER */ #endif
init/Kconfig +2 -2
@@ -489,11 +489,11 @@ config VIRT_CPU_ACCOUNTING_NATIVE config VIRT_CPU_ACCOUNTING_GEN bool "Full dynticks CPU time accounting" - depends on HAVE_CONTEXT_TRACKING + depends on HAVE_CONTEXT_TRACKING_USER depends on HAVE_VIRT_CPU_ACCOUNTING_GEN depends on GENERIC_CLOCKEVENTS select VIRT_CPU_ACCOUNTING - select CONTEXT_TRACKING + select CONTEXT_TRACKING_USER help Select this option to enable task and CPU time accounting on full dynticks systems. This accounting is implemented by watching every
kernel/context_tracking.c +5 -1
@@ -22,6 +22,8 @@#include <linux/export.h> #include <linux/kprobes.h> +#ifdef CONFIG_CONTEXT_TRACKING_USER +#define CREATE_TRACE_POINTS #include <trace/events/context_tracking.h>
@@ -252,7 +254,7 @@ void __init ct_cpu_track_user(int cpu) initialized = true; } -#ifdef CONFIG_CONTEXT_TRACKING_FORCE +#ifdef CONFIG_CONTEXT_TRACKING_USER_FORCE void __init context_tracking_init (void ) {int cpu;
@@ -261,3 +263,5 @@ void __init context_tracking_init(void)ct_cpu_track_user (cpu); }#endif + +#endif /* #ifdef CONFIG_CONTEXT_TRACKING_USER */
kernel/sched/core.c +1 -1
@@ -4654,7 +4654,7 @@ void __sched schedule_idle(void) }while (need_resched ()); } -#ifdef CONFIG_CONTEXT_TRACKING +#ifdef CONFIG_CONTEXT_TRACKING_USER asmlinkage __visible void __sched schedule_user(void) {/*
kernel/time/Kconfig +20 -11
@@ -61,6 +61,9 @@ config POSIX_CPU_TIMERS_TASK_WORK bool default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK +config CONTEXT_TRACKING + bool + if GENERIC_CLOCKEVENTS menu "Timers subsystem"
@@ -102,7 +105,7 @@ config NO_HZ_FULL depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS # We need at least one periodic CPU for timekeeping depends on SMP - depends on HAVE_CONTEXT_TRACKING + depends on HAVE_CONTEXT_TRACKING_USER # VIRT_CPU_ACCOUNTING_GEN dependency depends on HAVE_VIRT_CPU_ACCOUNTING_GEN select NO_HZ_COMMON
@@ -127,31 +130,37 @@ config NO_HZ_FULL endchoice -config CONTEXT_TRACKING - bool +config CONTEXT_TRACKING_USER + bool + depends on HAVE_CONTEXT_TRACKING_USER + select CONTEXT_TRACKING + help + Track transitions between kernel and user on behalf of RCU and + tickless cputime accounting. The former case relies on context + tracking to enter/exit RCU extended quiescent states. -config CONTEXT_TRACKING_FORCE - bool "Force context tracking" - depends on CONTEXT_TRACKING +config CONTEXT_TRACKING_USER_FORCE + bool "Force user context tracking" + depends on CONTEXT_TRACKING_USER default y if !NO_HZ_FULL help The major pre-requirement for full dynticks to work is to - support the context tracking subsystem. But there are also + support the user context tracking subsystem. But there are also other dependencies to provide in order to make the full dynticks working. This option stands for testing when an arch implements the - context tracking backend but doesn't yet fullfill all the + user context tracking backend but doesn't yet fullfill all the requirements to make the full dynticks feature working. Without the full dynticks, there is no way to test the support - for context tracking and the subsystems that rely on it: RCU + for user context tracking and the subsystems that rely on it: RCU userspace extended quiescent state and tickless cputime accounting. This option copes with the absence of the full - dynticks subsystem by forcing the context tracking on all + dynticks subsystem by forcing the user context tracking on all CPUs in the system. Say Y only if you're working on the development of an - architecture backend for the context tracking. + architecture backend for the user context tracking. Say N otherwise, this option brings an overhead that you don't want in production.
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 5/5 ARM: 9477/1: Disable broken eBPF JIT on the Risc PC
In reply to Sasha LevinFrom: Ethan Nelson-Moore <[email protected]>
[ Upstream commit 7e8ee82e69fde9d589272ec5e6f702358903be1f ]
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 machine whose kernel is built for ARMv3).
Comments from Ethan Nelson-Moore:
From LKML: https://lore.kernel.org/all/CAD++jL=0qYGoygUwGEXQL7C_ROnC7kfpRv8RA+H5tNWwYu+pQA@mail.gmail.com/
The commit message has been updated slightly relative to the version on LKML to clarify that the Risc PC is not actually ARMv3.
--- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
@@ -75,7 +75,7 @@ config ARM select HAVE_ARCH_THREAD_STRUCT_WHITELIST select HAVE_ARCH_TRACEHOOK 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_DEBUG_KMEMLEAK if !XIP_KERNEL
Signature · 1 line
2.53.0