]> xenbits.xensource.com Git - xen.git/commit
xen/sched: fix adding offline cpu to cpupool
authorJuergen Gross <jgross@suse.com>
Tue, 5 Dec 2023 08:57:38 +0000 (09:57 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Dec 2023 08:57:38 +0000 (09:57 +0100)
commit06e8d65d33896aa90f5b6d9b2bce7f11433b33c9
tree6920dc5c566d181cf17fe4bc9ffb0d2f6eb6a62e
parent787d11c5aaf4d3411d4658cff137cd49b0bd951b
xen/sched: fix adding offline cpu to cpupool

Trying to add an offline cpu to a cpupool can crash the hypervisor,
as the probably non-existing percpu area of the cpu is accessed before
the availability of the cpu is being tested. This can happen in case
the cpupool's granularity is "core" or "socket".

Fix that by testing the cpu to be online.

Fixes: cb563d7665f2 ("xen/sched: support core scheduling for moving cpus to/from cpupools")
Reported-by: René Winther Højgaard <renewin@proton.me>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/sched/cpupool.c