* [PATCH v6.18 1/3] ARM: 9459/1: Disable jump-label on PREEMPT_RT
2026-06-29 14:41 [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Sebastian Andrzej Siewior
@ 2026-06-29 14:41 ` Sebastian Andrzej Siewior
2026-06-29 14:41 ` [PATCH v6.18 2/3] ARM: ensure interrupts are enabled in __do_user_fault() Sebastian Andrzej Siewior
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-06-29 14:41 UTC (permalink / raw)
To: stable
Cc: Jan Kiszka, Jon Humphreys, Russell King, Thomas Gleixner,
Mark Rutland, Ard Biesheuvel, Arnd Bergmann, Linus Walleij,
Sebastian Andrzej Siewior
From: Thomas Gleixner <tglx@linutronix.de>
commit 256d97d3587b441630c345ab3d773a9e7dcd964b upstream.
jump-labels are used to efficiently switch between two possible code
paths. To achieve this, stop_machine() is used to keep the CPU in a
known state while the opcode is modified. The usage of stop_machine()
here leads to large latency spikes which can be observed on PREEMPT_RT.
Jump labels may change the target during runtime and are not restricted
to debug or "configuration/ setup" part of a PREEMPT_RT system where
high latencies could be defined as acceptable.
On 64-bit Arm, it is possible to use jump labels without the
stop_machine() call, which architecturally provides a way to atomically
change one 32-bit instruction word while keeping maintaining consistency,
but this is not generally the case on 32-bit, in particular in thumb2
mode.
Disable jump-label support on a PREEMPT_RT system when SMP is enabled.
[bigeasy: Patch description.]
[arnd: add !SMP case, extend changelog]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e481254e36455..b7f3ad66ff15f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -82,7 +82,7 @@ config ARM
select HAS_IOPORT
select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT
select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6
- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU
+ select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && (!PREEMPT_RT || !SMP)
select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL
select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU
select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v6.18 2/3] ARM: ensure interrupts are enabled in __do_user_fault()
2026-06-29 14:41 [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Sebastian Andrzej Siewior
2026-06-29 14:41 ` [PATCH v6.18 1/3] ARM: 9459/1: Disable jump-label on PREEMPT_RT Sebastian Andrzej Siewior
@ 2026-06-29 14:41 ` Sebastian Andrzej Siewior
2026-06-29 14:41 ` [PATCH v6.18 3/3] ARM: 9463/1: Allow to enable RT Sebastian Andrzej Siewior
2026-07-02 14:06 ` [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Greg KH
3 siblings, 0 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-06-29 14:41 UTC (permalink / raw)
To: stable
Cc: Jan Kiszka, Jon Humphreys, Russell King, Yadi.hu,
Sebastian Andrzej Siewior
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
commit 59e4f3b45b96a24fc9b7a89e5f8a2168b30f95af upstream.
__do_user_fault() may be called from fault handling paths where the
interrupts are enabled or disabled. E.g. do_page_fault() calls this
with interrupts enabled, whereas do_sect_fault()->do_bad_area()
will call this with interrupts disabled. Since this is a userspace
fault, we know that interrupts were enabled in the parent context,
so call local_irq_enable() here to give a consistent interrupt state.
This is necessary for force_sig_info() when PREEMPT_RT is enabled.
Reported-by: Yadi.hu <yadi.hu@windriver.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/mm/fault.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index ed4330cc3f4e6..6c27ebd490938 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -190,7 +190,8 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
/*
* Something tried to access memory that isn't in our memory map..
- * User mode accesses just cause a SIGSEGV
+ * User mode accesses just cause a SIGSEGV. Ensure interrupts are enabled
+ * for preempt RT.
*/
static void
__do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
@@ -198,6 +199,8 @@ __do_user_fault(unsigned long addr, unsigned int fsr, unsigned int sig,
{
struct task_struct *tsk = current;
+ local_irq_enable();
+
#ifdef CONFIG_DEBUG_USER
if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
@@ -268,6 +271,7 @@ do_kernel_address_page_fault(struct mm_struct *mm, unsigned long addr,
* should not be faulting in kernel space, which includes the
* vector/khelper page. Handle the branch predictor hardening
* while interrupts are still disabled, then send a SIGSEGV.
+ * Note that __do_user_fault() will enable interrupts.
*/
harden_branch_predictor();
__do_user_fault(addr, fsr, SIGSEGV, SEGV_MAPERR, regs);
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v6.18 3/3] ARM: 9463/1: Allow to enable RT
2026-06-29 14:41 [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Sebastian Andrzej Siewior
2026-06-29 14:41 ` [PATCH v6.18 1/3] ARM: 9459/1: Disable jump-label on PREEMPT_RT Sebastian Andrzej Siewior
2026-06-29 14:41 ` [PATCH v6.18 2/3] ARM: ensure interrupts are enabled in __do_user_fault() Sebastian Andrzej Siewior
@ 2026-06-29 14:41 ` Sebastian Andrzej Siewior
2026-07-02 14:06 ` [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Greg KH
3 siblings, 0 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-06-29 14:41 UTC (permalink / raw)
To: stable
Cc: Jan Kiszka, Jon Humphreys, Russell King,
Sebastian Andrzej Siewior, Linus Walleij, Arnd Bergmann
commit c6e61c06d6061750597e79c598acb5dead44c35b upstream.
All known issues have been adressed.
Allow to select RT.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b7f3ad66ff15f..bfb1734e50bec 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -41,6 +41,7 @@ config ARM
select ARCH_SUPPORTS_CFI
select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
select ARCH_SUPPORTS_PER_VMA_LOCK
+ select ARCH_SUPPORTS_RT
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_CMPXCHG_LOCKREF
select ARCH_USE_MEMTEST
--
2.53.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v6.18 0/3] ARM: PREEMPT_RT backports
2026-06-29 14:41 [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Sebastian Andrzej Siewior
` (2 preceding siblings ...)
2026-06-29 14:41 ` [PATCH v6.18 3/3] ARM: 9463/1: Allow to enable RT Sebastian Andrzej Siewior
@ 2026-07-02 14:06 ` Greg KH
2026-07-06 8:59 ` Sebastian Andrzej Siewior
3 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2026-07-02 14:06 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: stable, Jan Kiszka, Jon Humphreys, Russell King
On Mon, Jun 29, 2026 at 04:41:28PM +0200, Sebastian Andrzej Siewior wrote:
> Hi,
>
> ARM missed the PREEMPT_RT window for v6.18. The following three patches
> have been merged as of v7.1-rc1 and are the missing pieces.
>
> I've been asked by people if it would be possible to include them in the
> stable tree as it would make their life easier.
Why can't the -rt patchset just include these? Why put the burden on
us?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v6.18 0/3] ARM: PREEMPT_RT backports
2026-07-02 14:06 ` [PATCH v6.18 0/3] ARM: PREEMPT_RT backports Greg KH
@ 2026-07-06 8:59 ` Sebastian Andrzej Siewior
2026-07-06 9:27 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-07-06 8:59 UTC (permalink / raw)
To: Greg KH; +Cc: stable, Jan Kiszka, Jon Humphreys, Russell King
On 2026-07-02 16:06:48 [+0200], Greg KH wrote:
> On Mon, Jun 29, 2026 at 04:41:28PM +0200, Sebastian Andrzej Siewior wrote:
> > Hi,
> >
> > ARM missed the PREEMPT_RT window for v6.18. The following three patches
> > have been merged as of v7.1-rc1 and are the missing pieces.
> >
> > I've been asked by people if it would be possible to include them in the
> > stable tree as it would make their life easier.
>
> Why can't the -rt patchset just include these? Why put the burden on
> us?
It is part of the -rt patchset. I've been asked if it would be possible
to include it (ARM support) as part of -stable tree. I've been looking
at what is missing and it included two Kconfig changes and one code
change. This looked small so I thought maybe, why not let's ask. I'm
sorry if it looked other than asking.
If this puts burden on you and it does not qualify for a stable change
then it can't be included.
> thanks,
>
> greg k-h
Sebastian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6.18 0/3] ARM: PREEMPT_RT backports
2026-07-06 8:59 ` Sebastian Andrzej Siewior
@ 2026-07-06 9:27 ` Greg KH
2026-07-06 9:30 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2026-07-06 9:27 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: stable, Jan Kiszka, Jon Humphreys, Russell King
On Mon, Jul 06, 2026 at 10:59:40AM +0200, Sebastian Andrzej Siewior wrote:
> On 2026-07-02 16:06:48 [+0200], Greg KH wrote:
> > On Mon, Jun 29, 2026 at 04:41:28PM +0200, Sebastian Andrzej Siewior wrote:
> > > Hi,
> > >
> > > ARM missed the PREEMPT_RT window for v6.18. The following three patches
> > > have been merged as of v7.1-rc1 and are the missing pieces.
> > >
> > > I've been asked by people if it would be possible to include them in the
> > > stable tree as it would make their life easier.
> >
> > Why can't the -rt patchset just include these? Why put the burden on
> > us?
>
> It is part of the -rt patchset. I've been asked if it would be possible
> to include it (ARM support) as part of -stable tree. I've been looking
> at what is missing and it included two Kconfig changes and one code
> change. This looked small so I thought maybe, why not let's ask. I'm
> sorry if it looked other than asking.
>
> If this puts burden on you and it does not qualify for a stable change
> then it can't be included.
Please let's have new features stick to feature-patchsets like the -rt
kernel is, and not put that burden on us stable maintainers for
something that we don't use :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v6.18 0/3] ARM: PREEMPT_RT backports
2026-07-06 9:27 ` Greg KH
@ 2026-07-06 9:30 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-07-06 9:30 UTC (permalink / raw)
To: Greg KH; +Cc: stable, Jan Kiszka, Jon Humphreys, Russell King
On 2026-07-06 11:27:33 [+0200], Greg KH wrote:
> Please let's have new features stick to feature-patchsets like the -rt
> kernel is, and not put that burden on us stable maintainers for
> something that we don't use :)
Understood.
> thanks,
>
> greg k-h
Sebastian
^ permalink raw reply [flat|nested] 8+ messages in thread