While looking at OVMF and how it handles CPUs (ACPI/AP wakeup),
I've noticed that it uses legacy FW_CFG_NB_CPUS(0x05) to get
the number of present at start CPUs.
Variable was introduced back in 2008 by fbfcf955ba and is/was used
by ppc/sparc/arm/x86 and a bunch of firmwares (but not by SeaBIOS).

However in 2.8 I've just added similar fwcfg file 'etc/boot-cpus'
which is used for the same purpose \-)

Both variables are UINT16 and the only difference that FW_CFG_NB_CPUS
doesn't account for CPUs added with -device which might make
a firmware to wait indefinitely in FW_CFG_NB_CPUS == Woken-up-APs loop
due to extra not expected APs being woken up.

FW_CFG_NB_CPUS should be fixed to mimic 'etc/boot-cpus' behavior anyway,
so question arises why not to reuse fixed legacy FW_CFG_NB_CPUS and
drop just added but not yet released 'etc/boot-cpus' from QEMU and SeaBIOS.

Any opinions?


Reply via email to