Message ID | 20200120235159.18510-2-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | hw/arm/raspi: Run U-Boot on the raspi machines | expand |
On Tue, Jan 21, 2020 at 9:53 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote: > > Since we enabled parallel TCG code generation for softmmu (see > commit 3468b59 "tcg: enable multiple TCG contexts in softmmu") > and its subsequent fix (commit 72649619 "add .min_cpus and > .default_cpus fields to machine_class"), the raspi machines are > restricted to always use their 4 cores: > > See in hw/arm/raspi2 (with BCM283X_NCPUS set to 4): > > 222 static void raspi2_machine_init(MachineClass *mc) > 223 { > 224 mc->desc = "Raspberry Pi 2"; > 230 mc->max_cpus = BCM283X_NCPUS; > 231 mc->min_cpus = BCM283X_NCPUS; > 232 mc->default_cpus = BCM283X_NCPUS; > 235 }; > 236 DEFINE_MACHINE("raspi2", raspi2_machine_init) > > We can no longer use the -smp option, as we get: > > $ qemu-system-arm -M raspi2 -smp 1 > qemu-system-arm: Invalid SMP CPUs 1. The min CPUs supported by machine 'raspi2' is 4 > > Since we can not set the TYPE_BCM283x SOC "enabled-cpus" with -smp, > remove the unuseful code. > > We can achieve the same by using the '-global bcm2836.enabled-cpus=1' > option. > > Reported-by: Laurent Bonnans <laurent.bonnans@here.com> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Alistair > --- > Cc: Emilio G. Cota <cota@braap.org> > Cc: Richard Henderson <richard.henderson@linaro.org> > Cc: Andrew Baumann <Andrew.Baumann@microsoft.com> > Cc: Eduardo Habkost <ehabkost@redhat.com> > --- > hw/arm/raspi.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c > index 6a510aafc1..3996f6c63a 100644 > --- a/hw/arm/raspi.c > +++ b/hw/arm/raspi.c > @@ -192,8 +192,6 @@ static void raspi_init(MachineState *machine, int version) > /* Setup the SOC */ > object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram), > &error_abort); > - object_property_set_int(OBJECT(&s->soc), machine->smp.cpus, "enabled-cpus", > - &error_abort); > int board_rev = version == 3 ? 0xa02082 : 0xa21041; > object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev", > &error_abort); > -- > 2.21.1 > >
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index 6a510aafc1..3996f6c63a 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -192,8 +192,6 @@ static void raspi_init(MachineState *machine, int version) /* Setup the SOC */ object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(&s->ram), &error_abort); - object_property_set_int(OBJECT(&s->soc), machine->smp.cpus, "enabled-cpus", - &error_abort); int board_rev = version == 3 ? 0xa02082 : 0xa21041; object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev", &error_abort);
Since we enabled parallel TCG code generation for softmmu (see commit 3468b59 "tcg: enable multiple TCG contexts in softmmu") and its subsequent fix (commit 72649619 "add .min_cpus and .default_cpus fields to machine_class"), the raspi machines are restricted to always use their 4 cores: See in hw/arm/raspi2 (with BCM283X_NCPUS set to 4): 222 static void raspi2_machine_init(MachineClass *mc) 223 { 224 mc->desc = "Raspberry Pi 2"; 230 mc->max_cpus = BCM283X_NCPUS; 231 mc->min_cpus = BCM283X_NCPUS; 232 mc->default_cpus = BCM283X_NCPUS; 235 }; 236 DEFINE_MACHINE("raspi2", raspi2_machine_init) We can no longer use the -smp option, as we get: $ qemu-system-arm -M raspi2 -smp 1 qemu-system-arm: Invalid SMP CPUs 1. The min CPUs supported by machine 'raspi2' is 4 Since we can not set the TYPE_BCM283x SOC "enabled-cpus" with -smp, remove the unuseful code. We can achieve the same by using the '-global bcm2836.enabled-cpus=1' option. Reported-by: Laurent Bonnans <laurent.bonnans@here.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- Cc: Emilio G. Cota <cota@braap.org> Cc: Richard Henderson <richard.henderson@linaro.org> Cc: Andrew Baumann <Andrew.Baumann@microsoft.com> Cc: Eduardo Habkost <ehabkost@redhat.com> --- hw/arm/raspi.c | 2 -- 1 file changed, 2 deletions(-)