summaryrefslogtreecommitdiff
path: root/hw/arm
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2016-02-11 11:17:32 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-02-11 11:17:32 +0000
commit7ea686f5dda7cb9a5425fab716ce41260eeecf15 (patch)
treecccefbdf029616553d20d25391e24ab114b02620 /hw/arm
parent97f4ed3b71cca015e82bb601a17cd816b83fff05 (diff)
downloadqemu-7ea686f5dda7cb9a5425fab716ce41260eeecf15.zip
hw/arm/virt: fix max-cpus check
mach-virt doesn't yet support hotplug, but command lines specifying -smp <num>,maxcpus=<bigger-num> don't fail. Of course specifying bigger-num as something bigger than the machine supports, e.g. > 8 on a gicv2 machine, should fail though. This fix also makes mach- virt's max-cpus check truly consistent with the one in vl.c:main, as the one there was already correctly checking max-cpus instead of smp-cpus. Reported-by: Shannon Zhao <shannon.zhao@linaro.org> Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org> Message-id: 1454511578-24863-1-git-send-email-drjones@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/virt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 15658f49c4..44bbbea92b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1013,7 +1013,7 @@ static void machvirt_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *secure_sysmem = NULL;
int gic_version = vms->gic_version;
- int n, max_cpus;
+ int n, virt_max_cpus;
MemoryRegion *ram = g_new(MemoryRegion, 1);
const char *cpu_model = machine->cpu_model;
VirtBoardInfo *vbi;
@@ -1051,15 +1051,15 @@ static void machvirt_init(MachineState *machine)
* many redistributors we can fit into the memory map.
*/
if (gic_version == 3) {
- max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
+ virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
} else {
- max_cpus = GIC_NCPU;
+ virt_max_cpus = GIC_NCPU;
}
- if (smp_cpus > max_cpus) {
+ if (max_cpus > virt_max_cpus) {
error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
"supported by machine 'mach-virt' (%d)",
- smp_cpus, max_cpus);
+ max_cpus, virt_max_cpus);
exit(1);
}