mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen: add assertion in default_vcpu0_location to protect against broken masks
When setting up the cpu sibling/etc masks on ARM I accidentally and incorrectly omitted a CPU from it's own sibling mask which caused this function to return an invalid cpu number which caused errors later when we tried to access per_cpu data for that invalid cpu. Add an assert to catch this in the future. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
52c18e15d5
commit
5dd2cbfba5
1 file changed
+1
@@ -192,6 +192,7 @@ static unsigned int default_vcpu0_location(cpumask_t *online)
|
||||
cpu = cpumask_first(&cpu_exclude_map);
|
||||
if ( cpumask_weight(&cpu_exclude_map) > 1 )
|
||||
cpu = cpumask_next(cpu, &cpu_exclude_map);
|
||||
ASSERT(cpu < nr_cpu_ids);
|
||||
for_each_cpu(i, online)
|
||||
{
|
||||
if ( cpumask_test_cpu(i, &cpu_exclude_map) )
|
||||
|
||||