[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/6] numa: Reject CPU indexes > max_cpus
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 2/6] numa: Reject CPU indexes > max_cpus |
Date: |
Thu, 19 Mar 2015 16:26:10 -0300 |
CPU index is always less than max_cpus, as documented at sysemu.h:
> The following shall be true for all CPUs:
> cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS
Reject configuration which uses invalid CPU indexes.
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
numa.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/numa.c b/numa.c
index 13b2f01..6b4ab0e 100644
--- a/numa.c
+++ b/numa.c
@@ -76,9 +76,11 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts
*opts, Error **errp)
}
for (cpus = node->cpus; cpus; cpus = cpus->next) {
- if (cpus->value >= MAX_CPUMASK_BITS) {
- error_setg(errp, "CPU number %" PRIu16 " is bigger than %d",
- cpus->value, MAX_CPUMASK_BITS - 1);
+ if (cpus->value >= max_cpus) {
+ error_setg(errp,
+ "CPU index (%" PRIu16 ")"
+ " should be smaller than maxcpus (%d)",
+ cpus->value, max_cpus);
return;
}
bitmap_set(numa_info[nodenr].node_cpu, cpus->value, 1);
--
2.1.0
- [Qemu-devel] [PULL 0/6] NUMA queue 2015-03-19, Eduardo Habkost, 2015/03/19
- [Qemu-devel] [PULL 1/6] numa: Fix off-by-one error at MAX_CPUMASK_BITS check, Eduardo Habkost, 2015/03/19
- [Qemu-devel] [PULL 4/6] numa: introduce machine callback for VCPU to node mapping, Eduardo Habkost, 2015/03/19
- [Qemu-devel] [PULL 2/6] numa: Reject CPU indexes > max_cpus,
Eduardo Habkost <=
- [Qemu-devel] [PULL 6/6] numa: Print warning if no node is assigned to a CPU, Eduardo Habkost, 2015/03/19
- [Qemu-devel] [PULL 3/6] numa: Reject configuration if CPU appears on multiple nodes, Eduardo Habkost, 2015/03/19
- [Qemu-devel] [PULL 5/6] pc: fix default VCPU to NUMA node mapping, Eduardo Habkost, 2015/03/19
- Re: [Qemu-devel] [PULL 0/6] NUMA queue 2015-03-19, Peter Maydell, 2015/03/20