From: Jan Kiszka <jan.kis...@siemens.com>

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

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 kernel/cobalt/init.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c
index f94943f2d0..5168b56035 100644
--- a/kernel/cobalt/init.c
+++ b/kernel/cobalt/init.c
@@ -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 */
 
-- 
2.26.2

Reply via email to