Skip to contentSkip to conversation

cobalt/init: Fail if CPU 0 is missing from real-time CPU mask

PATCH New Jan Kiszka 1 participant 1 message Jul 5, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 cobalt/init: Fail if CPU 0 is missing from real-time CPU mask

From: Jan Kiszka <[email protected]>

The core assumes in some places that CPU 0 is available for real-time. Therefore fail if the mask is excluding it.

---
 kernel/cobalt/init.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/cobalt/init.c +5 -0
index f94943f2d0..5168b56035 100644
@@ -202,6 +202,11 @@ static int __init xenomai_init(void)
 		set_realtime_core_state(COBALT_STATE_DISABLED);
 		return 0;
 	}
+	if (!cpumask_test_cpu(0, &xnsched_realtime_cpus)) {
+		printk(XENO_ERR "CPU 0 is missing in real-time CPU mask\n");
+		set_realtime_core_state(COBALT_STATE_DISABLED);
+		return -EINVAL;
+	}
 	cobalt_cpu_affinity = xnsched_realtime_cpus;
 #endif /* CONFIG_SMP */
 
Signature · 1 line
2.26.2