[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xen: add assertion in default_vcpu0_location to protect against broken masks
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1341309153 -3600 # Node ID 1b3198c8f140918574ccfe6baba92ef214d69c1a # Parent 46b201f42bf850e7d9a4cbef8fad59798898fabc 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@xxxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Keir Fraser <keir@xxxxxxx> Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- diff -r 46b201f42bf8 -r 1b3198c8f140 xen/common/domctl.c --- a/xen/common/domctl.c Tue Jul 03 10:52:32 2012 +0100 +++ b/xen/common/domctl.c Tue Jul 03 10:52:33 2012 +0100 @@ -192,6 +192,7 @@ static unsigned int default_vcpu0_locati 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) ) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |