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:
Ian Campbell committed 2012-07-03 10:52:33 +01:00
1 parent 52c18e15d5
commit 5dd2cbfba5
1 file changed
+1
+1
View File
@@ -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) )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.