public inbox for xenomai@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Prepare for Dovetail 6.19
@ 2026-02-20 11:27 Florian Bezdeka
  2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Florian Bezdeka @ 2026-02-20 11:27 UTC (permalink / raw)
  To: Xenomai; +Cc: Jan Kiszka, Florian Bezdeka

Hi all,

This are the necessary changes required for being able to build Xenomai
against the latest Linux / Dovetail versions.

Dovetail 6.19 is currently in the making and already build / tested
against this series. Without this changes the build will simply fail.

To: Xenomai <xenomai@lists.linux.dev>
Cc: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
Changes in v2:
- Rework patch 1, switch to cobalt specific API for newer kernels 
- Link to v1: https://lore.kernel.org/r/20260216-wip-flo-prepare-for-6-19-v1-0-f7362cdd2532@siemens.com

---
Florian Bezdeka (3):
      cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
      cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() in 6.19
      testsuite/switchtest: Add support for Dovetail >= 6.19

 include/cobalt/kernel/dovetail/pipeline/irq.h      |  6 +++
 include/cobalt/kernel/dovetail/pipeline/pipeline.h |  9 ++---
 include/cobalt/kernel/dovetail/pipeline/sirq.h     |  9 ++---
 .../cobalt/arch/arm/include/asm/xenomai/fptest.h   | 26 ++++---------
 .../cobalt/arch/arm64/include/asm/xenomai/fptest.h | 43 ++++++++++++++++++----
 .../cobalt/arch/x86/include/asm/xenomai/fptest.h   | 41 ++++++++++++---------
 kernel/cobalt/dovetail/tick.c                      |  8 ++--
 kernel/cobalt/rtdm/drvlib.c                        |  8 +++-
 kernel/drivers/testing/switchtest.c                | 19 +++-------
 9 files changed, 94 insertions(+), 75 deletions(-)
---
base-commit: 363115d15682076ea0766a55c3c5b1eed87e1225
change-id: 20260212-wip-flo-prepare-for-6-19-8fdbd4c58225

Best regards,
-- 
Florian Bezdeka <florian.bezdeka@siemens.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-20 11:27 [PATCH v2 0/3] Prepare for Dovetail 6.19 Florian Bezdeka
@ 2026-02-20 11:27 ` Florian Bezdeka
  2026-02-20 15:21   ` Jan Kiszka
  2026-02-24 21:11   ` Jan Kiszka
  2026-02-20 11:27 ` [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() " Florian Bezdeka
  2026-02-20 11:27 ` [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19 Florian Bezdeka
  2 siblings, 2 replies; 15+ messages in thread
From: Florian Bezdeka @ 2026-02-20 11:27 UTC (permalink / raw)
  To: Xenomai; +Cc: Jan Kiszka, Florian Bezdeka

The signature of __request_percpu_irq() got one additional affinity
parameter in 6.19 and 7.0 will remove the function entirely.

Dovetail 6.19 will introduce a new dovetail specific service called
request_percpu_irq_affinity_flags() that allows us to set flags and
affinity at the same time.

It might happen that older Dovetail versions get the new API via
backports, so the re-#definement for older kernels might get
obsolete earlier than dropping support for Dovetail < 6.19.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
 include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
 include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
 kernel/cobalt/dovetail/tick.c                      | 8 ++++----
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
--- a/include/cobalt/kernel/dovetail/pipeline/irq.h
+++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
@@ -5,6 +5,12 @@
 #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
 #define _COBALT_KERNEL_DOVETAIL_IRQ_H
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
+#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
+					  affinity, dev_id)                    \
+	__request_percpu_irq(irq, handler, flags, devname, dev_id)
+#endif
+
 static inline void xnintr_init_proc(void)
 {
 	/* N/A */
diff --git a/include/cobalt/kernel/dovetail/pipeline/pipeline.h b/include/cobalt/kernel/dovetail/pipeline/pipeline.h
index 2e6e66a2d6d4dbf407d4ce42fff8b84acc2931d0..f5ee443ada3788b8b0261f77ae7da5d5f69ef9f2 100644
--- a/include/cobalt/kernel/dovetail/pipeline/pipeline.h
+++ b/include/cobalt/kernel/dovetail/pipeline/pipeline.h
@@ -11,6 +11,7 @@
 #include <asm/xenomai/features.h>
 #include <asm/xenomai/syscall.h>
 #include <asm/syscall.h>
+#include <pipeline/irq.h>
 #include <pipeline/machine.h>
 
 typedef unsigned long spl_t;
@@ -42,11 +43,9 @@ static inline int pipeline_request_resched_ipi(void)
 		return 0;
 
 	/* Trap the out-of-band rescheduling interrupt. */
-	return __request_percpu_irq(RESCHEDULE_OOB_IPI,
-			pipeline_reschedule_ipi_handler,
-			IRQF_OOB,
-			"Xenomai reschedule",
-			&cobalt_machine_cpudata);
+	return request_percpu_irq_affinity_flags(
+		RESCHEDULE_OOB_IPI, pipeline_reschedule_ipi_handler, IRQF_OOB,
+		"Xenomai reschedule", NULL, &cobalt_machine_cpudata);
 }
 
 static inline void pipeline_free_resched_ipi(void)
diff --git a/include/cobalt/kernel/dovetail/pipeline/sirq.h b/include/cobalt/kernel/dovetail/pipeline/sirq.h
index 1da9d13b217081ba52ef0444b60d236ddb9c8a9e..00c08af784588d5239cf399d69800c914221b210 100644
--- a/include/cobalt/kernel/dovetail/pipeline/sirq.h
+++ b/include/cobalt/kernel/dovetail/pipeline/sirq.h
@@ -9,6 +9,7 @@
 
 #include <linux/irq_pipeline.h>
 #include <cobalt/kernel/assert.h>
+#include <pipeline/irq.h>
 
 /*
  * Wrappers to create "synthetic IRQs" the Dovetail way. Those
@@ -29,11 +30,9 @@ int pipeline_create_inband_sirq(irqreturn_t (*handler)(int irq, void *dev_id))
 	if (sirq == 0)
 		return -EAGAIN;
 
-	ret = __request_percpu_irq(sirq,
-			handler,
-			IRQF_NO_THREAD,
-			"Inband sirq",
-			&cobalt_machine_cpudata);
+	ret = request_percpu_irq_affinity_flags(sirq, handler, IRQF_NO_THREAD,
+						"Inband sirq", NULL,
+						&cobalt_machine_cpudata);
 
 	if (ret) {
 		irq_dispose_mapping(sirq);
diff --git a/kernel/cobalt/dovetail/tick.c b/kernel/cobalt/dovetail/tick.c
index 873b62471eac758fba5b86fa36b8265b6284dc87..fa7ef09eaf39cdc1fca5c68f22f57da0c1320789 100644
--- a/kernel/cobalt/dovetail/tick.c
+++ b/kernel/cobalt/dovetail/tick.c
@@ -8,6 +8,7 @@
 #include <linux/tick.h>
 #include <linux/clockchips.h>
 #include <cobalt/kernel/intr.h>
+#include <pipeline/irq.h>
 #include <pipeline/tick.h>
 #include <cobalt/kernel/sched.h>
 #include <cobalt/kernel/timer.h>
@@ -153,10 +154,9 @@ int pipeline_install_tick_proxy(void)
 	 * CPUs.
 	 */
 	if (num_possible_cpus() > 1) {
-		ret = __request_percpu_irq(TIMER_OOB_IPI,
-					tick_ipi_handler,
-					IRQF_OOB, "Xenomai timer IPI",
-					&cobalt_machine_cpudata);
+		ret = request_percpu_irq_affinity_flags(
+			TIMER_OOB_IPI, tick_ipi_handler, IRQF_OOB,
+			"Xenomai timer IPI", NULL, &cobalt_machine_cpudata);
 		if (ret)
 			return ret;
 	}

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() in 6.19
  2026-02-20 11:27 [PATCH v2 0/3] Prepare for Dovetail 6.19 Florian Bezdeka
  2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
@ 2026-02-20 11:27 ` Florian Bezdeka
  2026-02-20 15:25   ` Jan Kiszka
  2026-02-20 11:27 ` [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19 Florian Bezdeka
  2 siblings, 1 reply; 15+ messages in thread
From: Florian Bezdeka @ 2026-02-20 11:27 UTC (permalink / raw)
  To: Xenomai; +Cc: Jan Kiszka, Florian Bezdeka

Since 6.19 the signature of mm_get_unmapped_area() has one parameter
less. The (previously) first struct mm_struct *mm parameter has been
removed.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 kernel/cobalt/rtdm/drvlib.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
index 86788743fe47b228662ef16831b4281ddefd04ff..0258100db5bbcc04880ddc71632b7992e50168dc 100644
--- a/kernel/cobalt/rtdm/drvlib.c
+++ b/kernel/cobalt/rtdm/drvlib.c
@@ -1907,8 +1907,12 @@ driver_get_unmapped_area(struct file *filp,
 
 #ifdef CONFIG_MMU
 	/* Run default handler. */
-	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff,
-				    flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,19,0)
+	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff, flags);
+#else
+	return mm_get_unmapped_area(filp, addr, len, pgoff, flags);
+#endif
+
 #else
 	return -ENODEV;
 #endif

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19
  2026-02-20 11:27 [PATCH v2 0/3] Prepare for Dovetail 6.19 Florian Bezdeka
  2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
  2026-02-20 11:27 ` [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() " Florian Bezdeka
@ 2026-02-20 11:27 ` Florian Bezdeka
  2026-02-20 15:31   ` Jan Kiszka
  2 siblings, 1 reply; 15+ messages in thread
From: Florian Bezdeka @ 2026-02-20 11:27 UTC (permalink / raw)
  To: Xenomai; +Cc: Jan Kiszka, Florian Bezdeka

The background for this reworking is a recent change to Linux in 6.19:

commit 4fa617cc6851 ("arm64/fpsimd: Allocate kernel mode FP/SIMD
		     buffers on the stack")

expects all (non-preemtable) users to provide a buffer that is used
in case the calling task is scheduled out. NULL is only allowed when
preemption is disabled.

preempt_disable() has no impact on OOB tasks, so when an OOB task is
scheduled out the fpsimd code tries to save the FPU regs to NULL, which
(obviously) triggered a fault.

To be able to provide a struct user_fpsimd_state located on the stack
the complete FPU usage has to move into one function, now called
arch_cobalt_in_kernel_fpu_usage() and implemented by all architectures.
arm64 needs two implementations to stay compatible with older kernels.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 .../cobalt/arch/arm/include/asm/xenomai/fptest.h   | 26 ++++---------
 .../cobalt/arch/arm64/include/asm/xenomai/fptest.h | 43 ++++++++++++++++++----
 .../cobalt/arch/x86/include/asm/xenomai/fptest.h   | 41 ++++++++++++---------
 kernel/drivers/testing/switchtest.c                | 19 +++-------
 4 files changed, 70 insertions(+), 59 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/fptest.h b/kernel/cobalt/arch/arm/include/asm/xenomai/fptest.h
index fc177fcb53bd259011a4a65f889c236f7c8e115e..f9f61109db07351283612f6e3a69a179c0a51e34 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/fptest.h
@@ -19,29 +19,17 @@
 #ifndef _COBALT_ARM_FPTEST_H
 #define _COBALT_ARM_FPTEST_H
 
-#include <linux/errno.h>
-#include <asm/hwcap.h>
-
-#ifdef CONFIG_VFP
-#define have_vfp (elf_hwcap & HWCAP_VFP)
-#else /* !CONFIG_VFP */
-#define have_vfp 0
-#endif /* !CONFIG_VFP */
-
-#include <asm/xenomai/uapi/fptest.h>
-
-static inline int fp_linux_begin(void)
-{
-	return -ENOSYS;
-}
-
-static inline void fp_linux_end(void)
+static inline int cobalt_arch_fp_detect(void)
 {
+	/* armhf: in-kernel-fpu-usage does not support preemption */
+	return 0;
 }
 
-static inline int fp_detect(void)
+static inline unsigned int
+cobalt_arch_in_kernel_fpu_usage(unsigned int expected, rtdm_event_t *rt_synch,
+				int (*report)(const char *fmt, ...))
 {
-	return have_vfp ? __COBALT_HAVE_VFP : 0;
+	return 0;
 }
 
 #endif /* _COBALT_ARM_FPTEST_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
index 520cd38519db66ad25baecedd183d56f92895539..e7f12a9c065a8d239488d90937dac4739c17bdeb 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
@@ -13,21 +13,48 @@
 
 #define have_fp (ELF_HWCAP & HWCAP_FP)
 
-static inline int fp_linux_begin(void)
+static inline int cobalt_arch_fp_detect(void)
 {
-	kernel_neon_begin();
-
-	return 0;
+	return have_fp ? __COBALT_HAVE_FPU : 0;
 }
 
-static inline void fp_linux_end(void)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,19,0)
+static inline unsigned int
+cobalt_arch_in_kernel_fpu_usage(unsigned int expected, rtdm_event_t *rt_synch,
+				int (*report)(const char *fmt, ...))
 {
+	int features = cobalt_arch_fp_detect();
+	unsigned int fp_val;
+
+	kernel_neon_begin();
+
+	fp_regs_set(features, expected);
+	rtdm_event_signal(rt_synch);
+	fp_val = fp_regs_check(features, expected, report);
+
 	kernel_neon_end();
-}
 
-static inline int fp_detect(void)
+	return fp_val;
+}
+# else
+static inline unsigned int
+cobalt_arch_in_kernel_fpu_usage(unsigned int expected, rtdm_event_t *rt_synch,
+				int (*report)(const char *fmt, ...))
 {
-	return have_fp ? __COBALT_HAVE_FPU : 0;
+	int features = cobalt_arch_fp_detect();
+	struct user_fpsimd_state fpu_state;
+	unsigned int fp_val;
+
+	kernel_neon_begin(&fpu_state);
+
+	fp_regs_set(features, expected);
+	rtdm_event_signal(rt_synch);
+	fp_val = fp_regs_check(features, expected, report);
+
+	kernel_neon_end(&fpu_state);
+
+	return fp_val;
 }
+#endif
 
 #endif /* !_COBALT_ARM64_FPTEST_H */
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
index 55818f853c2407eef40f3d1d9a1336bfa7605512..bbb7f3e5f3f9d09ebaf78499a07cc4e48c6dea0f 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
@@ -19,13 +19,30 @@
 #ifndef _COBALT_X86_ASM_FPTEST_H
 #define _COBALT_X86_ASM_FPTEST_H
 
-#include <linux/errno.h>
 #include <asm/processor.h>
 #include <asm/xenomai/wrappers.h>
 #include <asm/xenomai/uapi/fptest.h>
 
-static inline int fp_linux_begin(void)
+static inline int cobalt_arch_fp_detect(void)
 {
+	int features = 0;
+
+	if (boot_cpu_has(X86_FEATURE_XMM2))
+		features |= __COBALT_HAVE_SSE2;
+
+	if (boot_cpu_has(X86_FEATURE_AVX))
+		features |= __COBALT_HAVE_AVX;
+
+	return features;
+}
+
+static inline unsigned int
+cobalt_arch_in_kernel_fpu_usage(unsigned int expected, rtdm_event_t *rt_synch,
+				int (*report)(const char *fmt, ...))
+{
+	int features = cobalt_arch_fp_detect();
+	unsigned int fp_val;
+
 	kernel_fpu_begin();
 	/*
 	 * We need a clean context for testing the sanity of the FPU
@@ -35,25 +52,13 @@ static inline int fp_linux_begin(void)
 	 */
 	asm volatile("fninit");
 
-	return true;
-}
+	fp_regs_set(features, expected);
+	rtdm_event_signal(rt_synch);
+	fp_val = fp_regs_check(features, expected, report);
 
-static inline void fp_linux_end(void)
-{
 	kernel_fpu_end();
-}
 
-static inline int fp_detect(void)
-{
-	int features = 0;
-
-	if (boot_cpu_has(X86_FEATURE_XMM2))
-		features |= __COBALT_HAVE_SSE2;
-
-	if (boot_cpu_has(X86_FEATURE_AVX))
-		features |= __COBALT_HAVE_AVX;
-
-	return features;
+	return fp_val;
 }
 
 #endif /* _COBALT_X86_ASM_FPTEST_H */
diff --git a/kernel/drivers/testing/switchtest.c b/kernel/drivers/testing/switchtest.c
index f8f6c892076bba729d5d4b536288574df431e344..4a5d2bee7fe4f7ef265e2932e202ef4d8949496a 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -62,8 +62,6 @@ struct rtswitch_context {
 	rtdm_nrtsig_t wake_utask;
 };
 
-static int fp_features;
-
 static int report(const char *fmt, ...)
 {
 	va_list ap;
@@ -276,7 +274,7 @@ static int rtswitch_to_nrt(struct rtswitch_context *ctx,
 
 		case RTSWITCH_RT:
 
-			if (!fp_check || fp_linux_begin() < 0) {
+			if (!fp_check || !cobalt_arch_fp_detect()) {
 				fp_check = 0;
 				goto signal_nofp;
 			}
@@ -284,10 +282,8 @@ static int rtswitch_to_nrt(struct rtswitch_context *ctx,
 			expected = from_idx + 500 +
 				(ctx->switches_count % 4000000) * 1000;
 
-			fp_regs_set(fp_features, expected);
-			rtdm_event_signal(&to->rt_synch);
-			fp_val = fp_regs_check(fp_features, expected, report);
-			fp_linux_end();
+			fp_val = cobalt_arch_in_kernel_fpu_usage(
+				expected, &to->rt_synch, report);
 
 			if(down_interruptible(&from->nrt_synch))
 				return -EINTR;
@@ -308,11 +304,8 @@ static int rtswitch_to_nrt(struct rtswitch_context *ctx,
 				(ctx->switches_count % 4000000) * 1000;
 			barrier();
 
-			fp_linux_begin();
-			fp_regs_set(fp_features, expected);
-			rtdm_event_signal(&to->rt_synch);
-			fp_val = fp_regs_check(fp_features, expected, report);
-			fp_linux_end();
+			fp_val = cobalt_arch_in_kernel_fpu_usage(
+				expected, &to->rt_synch, report);
 
 			if (down_interruptible(&from->nrt_synch))
 				return -EINTR;
@@ -725,8 +718,6 @@ static struct rtdm_device device = {
 
 static int __init __switchtest_init(void)
 {
-	fp_features = fp_detect();
-
 	return rtdm_dev_register(&device);
 }
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
@ 2026-02-20 15:21   ` Jan Kiszka
  2026-02-24 21:11   ` Jan Kiszka
  1 sibling, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2026-02-20 15:21 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai

On 20.02.26 12:27, Florian Bezdeka wrote:
> The signature of __request_percpu_irq() got one additional affinity
> parameter in 6.19 and 7.0 will remove the function entirely.
> 
> Dovetail 6.19 will introduce a new dovetail specific service called
> request_percpu_irq_affinity_flags() that allows us to set flags and
> affinity at the same time.
> 
> It might happen that older Dovetail versions get the new API via
> backports, so the re-#definement for older kernels might get
> obsolete earlier than dropping support for Dovetail < 6.19.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>  4 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
> @@ -5,6 +5,12 @@
>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>  
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
> +					  affinity, dev_id)                    \
> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
> +#endif

Why not placing this in wrappers.h?

Jan

> +
>  static inline void xnintr_init_proc(void)
>  {
>  	/* N/A */
> diff --git a/include/cobalt/kernel/dovetail/pipeline/pipeline.h b/include/cobalt/kernel/dovetail/pipeline/pipeline.h
> index 2e6e66a2d6d4dbf407d4ce42fff8b84acc2931d0..f5ee443ada3788b8b0261f77ae7da5d5f69ef9f2 100644
> --- a/include/cobalt/kernel/dovetail/pipeline/pipeline.h
> +++ b/include/cobalt/kernel/dovetail/pipeline/pipeline.h
> @@ -11,6 +11,7 @@
>  #include <asm/xenomai/features.h>
>  #include <asm/xenomai/syscall.h>
>  #include <asm/syscall.h>
> +#include <pipeline/irq.h>
>  #include <pipeline/machine.h>
>  
>  typedef unsigned long spl_t;
> @@ -42,11 +43,9 @@ static inline int pipeline_request_resched_ipi(void)
>  		return 0;
>  
>  	/* Trap the out-of-band rescheduling interrupt. */
> -	return __request_percpu_irq(RESCHEDULE_OOB_IPI,
> -			pipeline_reschedule_ipi_handler,
> -			IRQF_OOB,
> -			"Xenomai reschedule",
> -			&cobalt_machine_cpudata);
> +	return request_percpu_irq_affinity_flags(
> +		RESCHEDULE_OOB_IPI, pipeline_reschedule_ipi_handler, IRQF_OOB,
> +		"Xenomai reschedule", NULL, &cobalt_machine_cpudata);
>  }
>  
>  static inline void pipeline_free_resched_ipi(void)
> diff --git a/include/cobalt/kernel/dovetail/pipeline/sirq.h b/include/cobalt/kernel/dovetail/pipeline/sirq.h
> index 1da9d13b217081ba52ef0444b60d236ddb9c8a9e..00c08af784588d5239cf399d69800c914221b210 100644
> --- a/include/cobalt/kernel/dovetail/pipeline/sirq.h
> +++ b/include/cobalt/kernel/dovetail/pipeline/sirq.h
> @@ -9,6 +9,7 @@
>  
>  #include <linux/irq_pipeline.h>
>  #include <cobalt/kernel/assert.h>
> +#include <pipeline/irq.h>
>  
>  /*
>   * Wrappers to create "synthetic IRQs" the Dovetail way. Those
> @@ -29,11 +30,9 @@ int pipeline_create_inband_sirq(irqreturn_t (*handler)(int irq, void *dev_id))
>  	if (sirq == 0)
>  		return -EAGAIN;
>  
> -	ret = __request_percpu_irq(sirq,
> -			handler,
> -			IRQF_NO_THREAD,
> -			"Inband sirq",
> -			&cobalt_machine_cpudata);
> +	ret = request_percpu_irq_affinity_flags(sirq, handler, IRQF_NO_THREAD,
> +						"Inband sirq", NULL,
> +						&cobalt_machine_cpudata);
>  
>  	if (ret) {
>  		irq_dispose_mapping(sirq);
> diff --git a/kernel/cobalt/dovetail/tick.c b/kernel/cobalt/dovetail/tick.c
> index 873b62471eac758fba5b86fa36b8265b6284dc87..fa7ef09eaf39cdc1fca5c68f22f57da0c1320789 100644
> --- a/kernel/cobalt/dovetail/tick.c
> +++ b/kernel/cobalt/dovetail/tick.c
> @@ -8,6 +8,7 @@
>  #include <linux/tick.h>
>  #include <linux/clockchips.h>
>  #include <cobalt/kernel/intr.h>
> +#include <pipeline/irq.h>
>  #include <pipeline/tick.h>
>  #include <cobalt/kernel/sched.h>
>  #include <cobalt/kernel/timer.h>
> @@ -153,10 +154,9 @@ int pipeline_install_tick_proxy(void)
>  	 * CPUs.
>  	 */
>  	if (num_possible_cpus() > 1) {
> -		ret = __request_percpu_irq(TIMER_OOB_IPI,
> -					tick_ipi_handler,
> -					IRQF_OOB, "Xenomai timer IPI",
> -					&cobalt_machine_cpudata);
> +		ret = request_percpu_irq_affinity_flags(
> +			TIMER_OOB_IPI, tick_ipi_handler, IRQF_OOB,
> +			"Xenomai timer IPI", NULL, &cobalt_machine_cpudata);
>  		if (ret)
>  			return ret;
>  	}
> 


-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() in 6.19
  2026-02-20 11:27 ` [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() " Florian Bezdeka
@ 2026-02-20 15:25   ` Jan Kiszka
  2026-02-24 16:02     ` Florian Bezdeka
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2026-02-20 15:25 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai

On 20.02.26 12:27, Florian Bezdeka wrote:
> Since 6.19 the signature of mm_get_unmapped_area() has one parameter
> less. The (previously) first struct mm_struct *mm parameter has been
> removed.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  kernel/cobalt/rtdm/drvlib.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
> index 86788743fe47b228662ef16831b4281ddefd04ff..0258100db5bbcc04880ddc71632b7992e50168dc 100644
> --- a/kernel/cobalt/rtdm/drvlib.c
> +++ b/kernel/cobalt/rtdm/drvlib.c
> @@ -1907,8 +1907,12 @@ driver_get_unmapped_area(struct file *filp,
>  
>  #ifdef CONFIG_MMU
>  	/* Run default handler. */
> -	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff,
> -				    flags);
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,19,0)
> +	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff, flags);
> +#else
> +	return mm_get_unmapped_area(filp, addr, len, pgoff, flags);
> +#endif

-> wrappers.h, extending the existing logic there, using the latest
pattern here.

Jan

> +
>  #else
>  	return -ENODEV;
>  #endif
> 

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19
  2026-02-20 11:27 ` [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19 Florian Bezdeka
@ 2026-02-20 15:31   ` Jan Kiszka
  0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2026-02-20 15:31 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai

On 20.02.26 12:27, Florian Bezdeka wrote:
> The background for this reworking is a recent change to Linux in 6.19:
> 
> commit 4fa617cc6851 ("arm64/fpsimd: Allocate kernel mode FP/SIMD
> 		     buffers on the stack")
> 
> expects all (non-preemtable) users to provide a buffer that is used
> in case the calling task is scheduled out. NULL is only allowed when
> preemption is disabled.
> 
> preempt_disable() has no impact on OOB tasks, so when an OOB task is
> scheduled out the fpsimd code tries to save the FPU regs to NULL, which
> (obviously) triggered a fault.
> 
> To be able to provide a struct user_fpsimd_state located on the stack
> the complete FPU usage has to move into one function, now called
> arch_cobalt_in_kernel_fpu_usage() and implemented by all architectures.
> arm64 needs two implementations to stay compatible with older kernels.

Can't we keep the test logic and the FPU setup/teardown split? What if
we provide a wrapper for allocating a state on the stack of the calling
function that - where needed - is then used by setup/teardown? It looks
a bit strange to that "rt_sync" event inside the FPU abstraction.

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() in 6.19
  2026-02-20 15:25   ` Jan Kiszka
@ 2026-02-24 16:02     ` Florian Bezdeka
  2026-02-24 16:36       ` Jan Kiszka
  0 siblings, 1 reply; 15+ messages in thread
From: Florian Bezdeka @ 2026-02-24 16:02 UTC (permalink / raw)
  To: Jan Kiszka, Xenomai

On Fri, 2026-02-20 at 16:25 +0100, Jan Kiszka wrote:
> On 20.02.26 12:27, Florian Bezdeka wrote:
> > Since 6.19 the signature of mm_get_unmapped_area() has one parameter
> > less. The (previously) first struct mm_struct *mm parameter has been
> > removed.
> > 
> > Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> > ---
> >  kernel/cobalt/rtdm/drvlib.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
> > index 86788743fe47b228662ef16831b4281ddefd04ff..0258100db5bbcc04880ddc71632b7992e50168dc 100644
> > --- a/kernel/cobalt/rtdm/drvlib.c
> > +++ b/kernel/cobalt/rtdm/drvlib.c
> > @@ -1907,8 +1907,12 @@ driver_get_unmapped_area(struct file *filp,
> >  
> >  #ifdef CONFIG_MMU
> >  	/* Run default handler. */
> > -	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff,
> > -				    flags);
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,19,0)
> > +	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff, flags);
> > +#else
> > +	return mm_get_unmapped_area(filp, addr, len, pgoff, flags);
> > +#endif
> 
> -> wrappers.h, extending the existing logic there, using the latest
> pattern here.
> 

Just realized that this function has more history in wrapping:

#if LINUX_VERSION_CODE < KERNEL_VERSION(6,10,0)
#define mm_get_unmapped_area(__mm, __filp, __addr, __len, __pgoff, __flags) \
	(__mm)->get_unmapped_area(__filp, __addr, __len, __pgoff, __flags)
#endif

Kernel versions < 6.19 will need 6 parameters, >= 6.19 will need 5. The
callers of the wrapper macro must agree in the number of parameters.

As we cannot touch other callers (Linux code), we have to align the
caller to the kernel version. I'm running out of ideas here...


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() in 6.19
  2026-02-24 16:02     ` Florian Bezdeka
@ 2026-02-24 16:36       ` Jan Kiszka
  0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2026-02-24 16:36 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai

On 24.02.26 17:02, Florian Bezdeka wrote:
> On Fri, 2026-02-20 at 16:25 +0100, Jan Kiszka wrote:
>> On 20.02.26 12:27, Florian Bezdeka wrote:
>>> Since 6.19 the signature of mm_get_unmapped_area() has one parameter
>>> less. The (previously) first struct mm_struct *mm parameter has been
>>> removed.
>>>
>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>> ---
>>>  kernel/cobalt/rtdm/drvlib.c | 8 ++++++--
>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
>>> index 86788743fe47b228662ef16831b4281ddefd04ff..0258100db5bbcc04880ddc71632b7992e50168dc 100644
>>> --- a/kernel/cobalt/rtdm/drvlib.c
>>> +++ b/kernel/cobalt/rtdm/drvlib.c
>>> @@ -1907,8 +1907,12 @@ driver_get_unmapped_area(struct file *filp,
>>>  
>>>  #ifdef CONFIG_MMU
>>>  	/* Run default handler. */
>>> -	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff,
>>> -				    flags);
>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,19,0)
>>> +	return mm_get_unmapped_area(current->mm, filp, addr, len, pgoff, flags);
>>> +#else
>>> +	return mm_get_unmapped_area(filp, addr, len, pgoff, flags);
>>> +#endif
>>
>> -> wrappers.h, extending the existing logic there, using the latest
>> pattern here.
>>
> 
> Just realized that this function has more history in wrapping:
> 
> #if LINUX_VERSION_CODE < KERNEL_VERSION(6,10,0)
> #define mm_get_unmapped_area(__mm, __filp, __addr, __len, __pgoff, __flags) \
> 	(__mm)->get_unmapped_area(__filp, __addr, __len, __pgoff, __flags)
> #endif
> 
> Kernel versions < 6.19 will need 6 parameters, >= 6.19 will need 5. The
> callers of the wrapper macro must agree in the number of parameters.
> 
> As we cannot touch other callers (Linux code), we have to align the
> caller to the kernel version. I'm running out of ideas here...
> 

The wrapper will only affect Xenomai users, thus does not need to worry
about other code in the kernel.

I'm not quite sure I understand the problem now, why you cannot
translate the inline wrapping above into a xenomai-generic one that
expands the 5-args call to 6 (using current->mm).

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
  2026-02-20 15:21   ` Jan Kiszka
@ 2026-02-24 21:11   ` Jan Kiszka
  2026-02-25 14:36     ` Jan Kiszka
  1 sibling, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2026-02-24 21:11 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai, Philippe Gerum

On 20.02.26 12:27, Florian Bezdeka wrote:
> The signature of __request_percpu_irq() got one additional affinity
> parameter in 6.19 and 7.0 will remove the function entirely.
> 
> Dovetail 6.19 will introduce a new dovetail specific service called
> request_percpu_irq_affinity_flags() that allows us to set flags and
> affinity at the same time.
> 
> It might happen that older Dovetail versions get the new API via
> backports, so the re-#definement for older kernels might get
> obsolete earlier than dropping support for Dovetail < 6.19.
> 
> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
> ---
>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>  4 files changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
> @@ -5,6 +5,12 @@
>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>  
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
> +					  affinity, dev_id)                    \
> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)

BTW, this effectively invalidates the affinity parameter. Before we
could make use of it, we would have to backport the dovetail function to
older kernels as well (6.1 right now).

At the same time, we seem to be forced to create all the OOB interrupts
on all the cores anyway, even when supported_cpus is set to a smaller
set. I do not recall why that is the case, I just vaguely remember
having asked this before. And as long as it is required, the new
affinity parameter will remain NULL.

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-24 21:11   ` Jan Kiszka
@ 2026-02-25 14:36     ` Jan Kiszka
  2026-02-25 16:43       ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2026-02-25 14:36 UTC (permalink / raw)
  To: Florian Bezdeka, Xenomai, Philippe Gerum

On 24.02.26 22:11, Jan Kiszka wrote:
> On 20.02.26 12:27, Florian Bezdeka wrote:
>> The signature of __request_percpu_irq() got one additional affinity
>> parameter in 6.19 and 7.0 will remove the function entirely.
>>
>> Dovetail 6.19 will introduce a new dovetail specific service called
>> request_percpu_irq_affinity_flags() that allows us to set flags and
>> affinity at the same time.
>>
>> It might happen that older Dovetail versions get the new API via
>> backports, so the re-#definement for older kernels might get
>> obsolete earlier than dropping support for Dovetail < 6.19.
>>
>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>> ---
>>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>>  4 files changed, 18 insertions(+), 14 deletions(-)
>>
>> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
>> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
>> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
>> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
>> @@ -5,6 +5,12 @@
>>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>>  
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
>> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
>> +					  affinity, dev_id)                    \
>> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
> 
> BTW, this effectively invalidates the affinity parameter. Before we
> could make use of it, we would have to backport the dovetail function to
> older kernels as well (6.1 right now).
> 

For the time being, I would like to have a WARN_ON_ONCE(affinity !=
NULL) in the wrapper so that we have a chance to detect future overuse
of the new API.

> At the same time, we seem to be forced to create all the OOB interrupts
> on all the cores anyway, even when supported_cpus is set to a smaller
> set. I do not recall why that is the case, I just vaguely remember
> having asked this before. And as long as it is required, the new
> affinity parameter will remain NULL.

Would still be interesting to recap this aspect, both for classic cobalt
(supported_cpus) but also the evl core (oobcpus). Even if the lock
contention in the absence of a global nklock is not there anymore, I
guess there would be value in not having to proxy the timer on cores
that do not host RT workload. But evl is currently requesting the proxy
for all cpus as well, isn't it?

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-25 14:36     ` Jan Kiszka
@ 2026-02-25 16:43       ` Philippe Gerum
  2026-02-25 19:08         ` Jan Kiszka
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2026-02-25 16:43 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Florian Bezdeka, Xenomai

Jan Kiszka <jan.kiszka@siemens.com> writes:

> On 24.02.26 22:11, Jan Kiszka wrote:
>> On 20.02.26 12:27, Florian Bezdeka wrote:
>>> The signature of __request_percpu_irq() got one additional affinity
>>> parameter in 6.19 and 7.0 will remove the function entirely.
>>>
>>> Dovetail 6.19 will introduce a new dovetail specific service called
>>> request_percpu_irq_affinity_flags() that allows us to set flags and
>>> affinity at the same time.
>>>
>>> It might happen that older Dovetail versions get the new API via
>>> backports, so the re-#definement for older kernels might get
>>> obsolete earlier than dropping support for Dovetail < 6.19.
>>>
>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>> ---
>>>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>>>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>>>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>>>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>>>  4 files changed, 18 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
>>> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
>>> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>> @@ -5,6 +5,12 @@
>>>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>  
>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
>>> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
>>> +					  affinity, dev_id)                    \
>>> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
>> 
>> BTW, this effectively invalidates the affinity parameter. Before we
>> could make use of it, we would have to backport the dovetail function to
>> older kernels as well (6.1 right now).
>> 
>
> For the time being, I would like to have a WARN_ON_ONCE(affinity !=
> NULL) in the wrapper so that we have a chance to detect future overuse
> of the new API.
>
>> At the same time, we seem to be forced to create all the OOB interrupts
>> on all the cores anyway, even when supported_cpus is set to a smaller
>> set. I do not recall why that is the case, I just vaguely remember
>> having asked this before. And as long as it is required, the new
>> affinity parameter will remain NULL.
>
> Would still be interesting to recap this aspect, both for classic cobalt
> (supported_cpus) but also the evl core (oobcpus). Even if the lock
> contention in the absence of a global nklock is not there anymore, I
> guess there would be value in not having to proxy the timer on cores
> that do not host RT workload. But evl is currently requesting the proxy
> for all cpus as well, isn't it?

Only on the evl_oob_cpus set (tick_install_proxy()).

-- 
Philippe.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-25 16:43       ` Philippe Gerum
@ 2026-02-25 19:08         ` Jan Kiszka
  2026-02-26  8:59           ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2026-02-25 19:08 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: Florian Bezdeka, Xenomai

On 25.02.26 17:43, Philippe Gerum wrote:
> Jan Kiszka <jan.kiszka@siemens.com> writes:
> 
>> On 24.02.26 22:11, Jan Kiszka wrote:
>>> On 20.02.26 12:27, Florian Bezdeka wrote:
>>>> The signature of __request_percpu_irq() got one additional affinity
>>>> parameter in 6.19 and 7.0 will remove the function entirely.
>>>>
>>>> Dovetail 6.19 will introduce a new dovetail specific service called
>>>> request_percpu_irq_affinity_flags() that allows us to set flags and
>>>> affinity at the same time.
>>>>
>>>> It might happen that older Dovetail versions get the new API via
>>>> backports, so the re-#definement for older kernels might get
>>>> obsolete earlier than dropping support for Dovetail < 6.19.
>>>>
>>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>>> ---
>>>>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>>>>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>>>>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>>>>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>>>>  4 files changed, 18 insertions(+), 14 deletions(-)
>>>>
>>>> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
>>>> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>> @@ -5,6 +5,12 @@
>>>>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>  
>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
>>>> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
>>>> +					  affinity, dev_id)                    \
>>>> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
>>>
>>> BTW, this effectively invalidates the affinity parameter. Before we
>>> could make use of it, we would have to backport the dovetail function to
>>> older kernels as well (6.1 right now).
>>>
>>
>> For the time being, I would like to have a WARN_ON_ONCE(affinity !=
>> NULL) in the wrapper so that we have a chance to detect future overuse
>> of the new API.
>>
>>> At the same time, we seem to be forced to create all the OOB interrupts
>>> on all the cores anyway, even when supported_cpus is set to a smaller
>>> set. I do not recall why that is the case, I just vaguely remember
>>> having asked this before. And as long as it is required, the new
>>> affinity parameter will remain NULL.
>>
>> Would still be interesting to recap this aspect, both for classic cobalt
>> (supported_cpus) but also the evl core (oobcpus). Even if the lock
>> contention in the absence of a global nklock is not there anymore, I
>> guess there would be value in not having to proxy the timer on cores
>> that do not host RT workload. But evl is currently requesting the proxy
>> for all cpus as well, isn't it?
> 
> Only on the evl_oob_cpus set (tick_install_proxy()).
> 

But per-cpu interrupts are requested for all cores, no?

Jan


-- 
Siemens AG, Foundational Technologies
Linux Expert Center

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-25 19:08         ` Jan Kiszka
@ 2026-02-26  8:59           ` Philippe Gerum
  2026-02-26  9:01             ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2026-02-26  8:59 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Florian Bezdeka, Xenomai

Jan Kiszka <jan.kiszka@siemens.com> writes:

> On 25.02.26 17:43, Philippe Gerum wrote:
>> Jan Kiszka <jan.kiszka@siemens.com> writes:
>> 
>>> On 24.02.26 22:11, Jan Kiszka wrote:
>>>> On 20.02.26 12:27, Florian Bezdeka wrote:
>>>>> The signature of __request_percpu_irq() got one additional affinity
>>>>> parameter in 6.19 and 7.0 will remove the function entirely.
>>>>>
>>>>> Dovetail 6.19 will introduce a new dovetail specific service called
>>>>> request_percpu_irq_affinity_flags() that allows us to set flags and
>>>>> affinity at the same time.
>>>>>
>>>>> It might happen that older Dovetail versions get the new API via
>>>>> backports, so the re-#definement for older kernels might get
>>>>> obsolete earlier than dropping support for Dovetail < 6.19.
>>>>>
>>>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>>>> ---
>>>>>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>>>>>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>>>>>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>>>>>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>>>>>  4 files changed, 18 insertions(+), 14 deletions(-)
>>>>>
>>>>> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
>>>>> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>> @@ -5,6 +5,12 @@
>>>>>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>>  
>>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
>>>>> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
>>>>> +					  affinity, dev_id)                    \
>>>>> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
>>>>
>>>> BTW, this effectively invalidates the affinity parameter. Before we
>>>> could make use of it, we would have to backport the dovetail function to
>>>> older kernels as well (6.1 right now).
>>>>
>>>
>>> For the time being, I would like to have a WARN_ON_ONCE(affinity !=
>>> NULL) in the wrapper so that we have a chance to detect future overuse
>>> of the new API.
>>>
>>>> At the same time, we seem to be forced to create all the OOB interrupts
>>>> on all the cores anyway, even when supported_cpus is set to a smaller
>>>> set. I do not recall why that is the case, I just vaguely remember
>>>> having asked this before. And as long as it is required, the new
>>>> affinity parameter will remain NULL.
>>>
>>> Would still be interesting to recap this aspect, both for classic cobalt
>>> (supported_cpus) but also the evl core (oobcpus). Even if the lock
>>> contention in the absence of a global nklock is not there anymore, I
>>> guess there would be value in not having to proxy the timer on cores
>>> that do not host RT workload. But evl is currently requesting the proxy
>>> for all cpus as well, isn't it?
>> 
>> Only on the evl_oob_cpus set (tick_install_proxy()).
>> 
>
> But per-cpu interrupts are requested for all cores, no?
>

Yes, but no tick events should be flowing on the non-oob cores since
there is no _active_ runqueue on those (although all runqueues are
initialized to recover from user misconfiguration of process
affinity). IOW, the evl core can and will use
request_percpu_irq_affinity_flags() when available.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19
  2026-02-26  8:59           ` Philippe Gerum
@ 2026-02-26  9:01             ` Philippe Gerum
  0 siblings, 0 replies; 15+ messages in thread
From: Philippe Gerum @ 2026-02-26  9:01 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Florian Bezdeka, Xenomai

Philippe Gerum <rpm@xenomai.org> writes:

> Jan Kiszka <jan.kiszka@siemens.com> writes:
>
>> On 25.02.26 17:43, Philippe Gerum wrote:
>>> Jan Kiszka <jan.kiszka@siemens.com> writes:
>>> 
>>>> On 24.02.26 22:11, Jan Kiszka wrote:
>>>>> On 20.02.26 12:27, Florian Bezdeka wrote:
>>>>>> The signature of __request_percpu_irq() got one additional affinity
>>>>>> parameter in 6.19 and 7.0 will remove the function entirely.
>>>>>>
>>>>>> Dovetail 6.19 will introduce a new dovetail specific service called
>>>>>> request_percpu_irq_affinity_flags() that allows us to set flags and
>>>>>> affinity at the same time.
>>>>>>
>>>>>> It might happen that older Dovetail versions get the new API via
>>>>>> backports, so the re-#definement for older kernels might get
>>>>>> obsolete earlier than dropping support for Dovetail < 6.19.
>>>>>>
>>>>>> Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
>>>>>> ---
>>>>>>  include/cobalt/kernel/dovetail/pipeline/irq.h      | 6 ++++++
>>>>>>  include/cobalt/kernel/dovetail/pipeline/pipeline.h | 9 ++++-----
>>>>>>  include/cobalt/kernel/dovetail/pipeline/sirq.h     | 9 ++++-----
>>>>>>  kernel/cobalt/dovetail/tick.c                      | 8 ++++----
>>>>>>  4 files changed, 18 insertions(+), 14 deletions(-)
>>>>>>
>>>>>> diff --git a/include/cobalt/kernel/dovetail/pipeline/irq.h b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>>> index 55d9b8ff17cd08e5e8c09aec393a1e23736c1b76..df0b8ceb05c25d655a331d238e7ef8ac8a6afeea 100644
>>>>>> --- a/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>>> +++ b/include/cobalt/kernel/dovetail/pipeline/irq.h
>>>>>> @@ -5,6 +5,12 @@
>>>>>>  #ifndef _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>>>  #define _COBALT_KERNEL_DOVETAIL_IRQ_H
>>>>>>  
>>>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 19, 0)
>>>>>> +#define request_percpu_irq_affinity_flags(irq, handler, flags, devname,        \
>>>>>> +					  affinity, dev_id)                    \
>>>>>> +	__request_percpu_irq(irq, handler, flags, devname, dev_id)
>>>>>
>>>>> BTW, this effectively invalidates the affinity parameter. Before we
>>>>> could make use of it, we would have to backport the dovetail function to
>>>>> older kernels as well (6.1 right now).
>>>>>
>>>>
>>>> For the time being, I would like to have a WARN_ON_ONCE(affinity !=
>>>> NULL) in the wrapper so that we have a chance to detect future overuse
>>>> of the new API.
>>>>
>>>>> At the same time, we seem to be forced to create all the OOB interrupts
>>>>> on all the cores anyway, even when supported_cpus is set to a smaller
>>>>> set. I do not recall why that is the case, I just vaguely remember
>>>>> having asked this before. And as long as it is required, the new
>>>>> affinity parameter will remain NULL.
>>>>
>>>> Would still be interesting to recap this aspect, both for classic cobalt
>>>> (supported_cpus) but also the evl core (oobcpus). Even if the lock
>>>> contention in the absence of a global nklock is not there anymore, I
>>>> guess there would be value in not having to proxy the timer on cores
>>>> that do not host RT workload. But evl is currently requesting the proxy
>>>> for all cpus as well, isn't it?
>>> 
>>> Only on the evl_oob_cpus set (tick_install_proxy()).
>>> 
>>
>> But per-cpu interrupts are requested for all cores, no?
>>
>
> Yes, but no tick events should be flowing on the non-oob cores since
> there is no _active_ runqueue on those (although all runqueues are
> initialized to recover from user misconfiguration of process
> affinity). IOW, the evl core can and will use
> request_percpu_irq_affinity_flags() when available.

In fact, no tick can ever happen on cpus out of the oob set precisely
because no proxy is installed for those.

-- 
Philippe.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-02-26  9:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-20 11:27 [PATCH v2 0/3] Prepare for Dovetail 6.19 Florian Bezdeka
2026-02-20 11:27 ` [PATCH v2 1/3] cobalt: Prepare for new signature of __request_percpu_irq() in 6.19 Florian Bezdeka
2026-02-20 15:21   ` Jan Kiszka
2026-02-24 21:11   ` Jan Kiszka
2026-02-25 14:36     ` Jan Kiszka
2026-02-25 16:43       ` Philippe Gerum
2026-02-25 19:08         ` Jan Kiszka
2026-02-26  8:59           ` Philippe Gerum
2026-02-26  9:01             ` Philippe Gerum
2026-02-20 11:27 ` [PATCH v2 2/3] cobalt/rtdm: Prepare for new signature of mm_get_unmapped_area() " Florian Bezdeka
2026-02-20 15:25   ` Jan Kiszka
2026-02-24 16:02     ` Florian Bezdeka
2026-02-24 16:36       ` Jan Kiszka
2026-02-20 11:27 ` [PATCH v2 3/3] testsuite/switchtest: Add support for Dovetail >= 6.19 Florian Bezdeka
2026-02-20 15:31   ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox