qemu-e2k/hw/arm
Cédric Le Goater b7f1a0cb76 arm/aspeed: Compute the number of CPUs from the SoC definition
Commit ece09beec4 ("aspeed: introduce a configurable number of CPU
per machine") was a convient change during bringup but the Aspeed SoCs
have a fixed number of CPUs : one for the AST2400 and AST2500, and two
for the AST2600.

When the number of CPUs configured with -smp is less than the SoC's
fixed number, the "unconfigured" CPUs are left unrealized. This can
happen for machines ast2600-evb and tacoma-bmc, where the SoC's fixed
number is 2. To get virtual hardware that matches the physical
hardware, you have to pass -smp cpus=2 (or its sugared form -smp 2).

We normally reject -smp cpus=N when N exceeds the machine's limit.
Except we ignore cpus=2 (and only cpus=2) with a warning for machines
ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc, swift-bmc, and
witherspoon-bmc.

Remove the "num-cpu" property from the SoC state and use the fixed
number of CPUs defined in the SoC class instead. Compute the default,
min, max number of CPUs of the machine directly from the SoC class
definition.

Machines ast2600-evb and tacoma-bmc now always get their second CPU as
they should. Visible in "info qom-tree"; here's the change for
ast2600-evb:

     /machine (ast2600-evb-machine)
       /peripheral (container)
       /peripheral-anon (container)
       /soc (ast2600-a1)
         /a7mpcore (a15mpcore_priv)
           /a15mp-priv-container[0] (qemu:memory-region)
           /gic (arm_gic)
             /gic_cpu[0] (qemu:memory-region)
             /gic_cpu[1] (qemu:memory-region)
    +        /gic_cpu[2] (qemu:memory-region)
             /gic_dist[0] (qemu:memory-region)
             /gic_vcpu[0] (qemu:memory-region)
             /gic_viface[0] (qemu:memory-region)
             /gic_viface[1] (qemu:memory-region)
    +        /gic_viface[2] (qemu:memory-region)
             /unnamed-gpio-in[0] (irq)
             [...]
    +        /unnamed-gpio-in[160] (irq)
             [same for 161 to 190...]
    +        /unnamed-gpio-in[191] (irq)

Also visible in "info qtree"; here's the change for ast2600-evb:

     bus: main-system-bus
       type System
       dev: a15mpcore_priv, id ""
         gpio-in "" 128
    -    gpio-out "sysbus-irq" 5
    -    num-cpu = 1 (0x1)
    +    gpio-out "sysbus-irq" 10
    +    num-cpu = 2 (0x2)
         num-irq = 160 (0xa0)
         mmio 0000000040460000/0000000000008000
       dev: arm_gic, id ""
    -    gpio-in "" 160
    -    num-cpu = 1 (0x1)
    +    gpio-in "" 192
    +    num-cpu = 2 (0x2)
         num-irq = 160 (0xa0)
         revision = 2 (0x2)
         has-security-extensions = true
         has-virtualization-extensions = true
         num-priority-bits = 8 (0x8)
         mmio ffffffffffffffff/0000000000001000
         mmio ffffffffffffffff/0000000000002000
         mmio ffffffffffffffff/0000000000001000
         mmio ffffffffffffffff/0000000000002000
         mmio ffffffffffffffff/0000000000000100
    +    mmio ffffffffffffffff/0000000000000100
    +    mmio ffffffffffffffff/0000000000000200
         mmio ffffffffffffffff/0000000000000200

The other machines now reject -smp cpus=2 just like -smp cpus=3 and up.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message expanded]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200609122339.937862-5-armbru@redhat.com>
2020-06-15 21:36:09 +02:00
..
allwinner-a10.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
allwinner-h3.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
armsse.c
armv7m.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
aspeed_ast2600.c arm/aspeed: Compute the number of CPUs from the SoC definition 2020-06-15 21:36:09 +02:00
aspeed_soc.c arm/aspeed: Compute the number of CPUs from the SoC definition 2020-06-15 21:36:09 +02:00
aspeed.c arm/aspeed: Compute the number of CPUs from the SoC definition 2020-06-15 21:36:09 +02:00
bcm2835_peripherals.c wire in the dwc-hsotg (dwc2) USB host controller emulation 2020-06-05 17:23:09 +01:00
bcm2836.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
boot.c
collie.c hw/arm/collie: Put StrongARMState* into a CollieMachineState struct 2020-04-03 19:23:37 +01:00
cubieboard.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
digic_boards.c
digic.c
exynos4_boards.c
exynos4210.c hw/arm: Let devices own the MemoryRegion they create 2020-03-17 15:18:50 +01:00
fsl-imx6.c hw/arm/fsl-imx6: Connect watchdog interrupts 2020-05-21 22:05:27 +01:00
fsl-imx6ul.c hw/arm/fsl-imx6ul: Connect watchdog interrupts 2020-05-21 22:05:27 +01:00
fsl-imx7.c hw/arm/fsl-imx7: Connect watchdog interrupts 2020-05-21 22:05:27 +01:00
fsl-imx25.c hw/arm/fsl-imx25: Wire up watchdog 2020-05-21 22:05:27 +01:00
fsl-imx31.c hw/arm/fsl-imx31: Wire up watchdog 2020-05-21 22:05:27 +01:00
gumstix.c
highbank.c
imx25_pdk.c hw/arm/fsl-imx25: Wire up eSDHC controllers 2020-03-12 16:27:33 +00:00
integratorcp.c hw/arm/integratorcp: Replace hw_error() by qemu_log_mask() 2020-05-21 22:05:27 +01:00
Kconfig hw/arm/fsl-imx31: Wire up watchdog 2020-05-21 22:05:27 +01:00
kzm.c
mainstone.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
Makefile.objs hw/arm: add Xunlong Orange Pi PC machine 2020-03-12 16:27:33 +00:00
mcimx6ul-evk.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
mcimx7d-sabre.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
microbit.c
mps2-tz.c hw/arm/mps2-tz: Use TYPE_IOTKIT instead of hardcoded string 2020-05-04 10:32:46 +01:00
mps2.c
msf2-soc.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
msf2-som.c
musca.c
musicpal.c hw/arm/musicpal: Map the UART devices unconditionally 2020-05-11 11:48:50 +01:00
netduino2.c
netduinoplus2.c
nrf51_soc.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
nseries.c
omap1.c
omap2.c
omap_sx1.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
orangepi.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
palm.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
pxa2xx_gpio.c hw/arm/pxa2xx: Replace hw_error() by qemu_log_mask() 2020-05-21 22:05:27 +01:00
pxa2xx_pic.c
pxa2xx.c hw/arm/pxa2xx: Replace printf() call by qemu_log_mask() 2020-06-05 17:23:08 +01:00
raspi.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
realview.c
sabrelite.c arm/sabrelite: Consistently use &error_fatal in sabrelite_init() 2020-05-27 07:45:45 +02:00
sbsa-ref.c hw: Use QEMU_IS_ALIGNED() on parallel flash block size 2020-05-18 19:05:25 +02:00
smmu-common.c
smmu-internal.h
smmuv3-internal.h
smmuv3.c
spitz.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
stellaris.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
stm32f205_soc.c hw/arm: Let devices own the MemoryRegion they create 2020-03-17 15:18:50 +01:00
stm32f405_soc.c arm/stm32f405: Fix realization of "stm32f2xx-adc" devices 2020-06-15 21:35:52 +02:00
strongarm.c
strongarm.h
sysbus-fdt.c hw/arm/virt: vTPM support 2020-03-05 12:18:16 -05:00
tosa.c hw/arm: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:46 +01:00
trace-events
versatilepb.c
vexpress.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
virt-acpi-build.c arm/acpi: TPM2 ACPI table support 2020-06-09 12:46:45 -04:00
virt.c hw: Use QEMU_IS_ALIGNED() on parallel flash block size 2020-05-18 19:05:25 +02:00
xilinx_zynq.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
xlnx-versal-virt.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
xlnx-versal.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
xlnx-zcu102.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
xlnx-zynqmp.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
z2.c