From f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Wed, 29 Jul 2026 14:06:43 +0200 Subject: [PATCH] xen/sched: fix schedule_dump() handling of free cpus With the introduction of core scheduling, cpus not used by any cpupool have been switched to use the very simple idle scheduler instead of the default scheduler. Trying to obtain diagnostic scheduling data via the "r" debug key is scanning through all cpupools using the per-cpupool scheduler to print the related data. Unfortunately the switch to use the idle scheduler for free cpus wasn't reflected in schedule_dump(), causing the default scheduler's dump_cpu_state callback to be used for free cpus. This causes NULL dereferences in case the default scheduler is one of credit or null. Fix that by using the idle scheduler instead of the default scheduler for free cpus. Note that it is fine for a scheduler to have no dump_cpu_state callback. Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus") Reported-by: Dietmar Hahn Tested-by: Dietmar Hahn Signed-off-by: Juergen Gross Acked-by: Andrew Cooper --- xen/common/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 55b71301cf..9ccf5811bf 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -3452,7 +3452,7 @@ void schedule_dump(struct cpupool *c) } else { - sched = &operations; + sched = &sched_idle_ops; cpus = &cpupool_free_cpus; }