On Mon, Feb 27, 2023 at 16:26:36 +0000, Daniel P. Berrangé wrote:
On Mon, Feb 27, 2023 at 04:27:36PM +0100, Peter Krempa wrote:
> The first part of the series is a straightforward replacement of
> '-no-acpi' by '-machine acpi=on/off' based on configuration.
>
> '-no-acpi' was recently deprecated by qemu thus we must adapt.
>
> The second part of this series fixes the use of ACPI (or lack thereof)
> for ARM machine types which don't support ACPI. We'll break such
> commandline by adding '-no-acpi' due to historical baggage.
Which machine types are you considering here ? Would that be
any machine type except the 'virt' machine type I guess ?
Indeed:
$ grep machine tests/qemucapabilitiesdata/caps_8.0.0.aarch64.xml | grep
"acpi='no'"
<machine type='tcg' name='integratorcp' maxCpus='1'
defaultCPU='arm926-arm-cpu' defaultRAMid='integrator.ram'
acpi='no'/>
<machine type='tcg' name='qcom-dc-scm-v1-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='mori-bmc' maxCpus='2'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='ast2600-evb' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='borzoi' maxCpus='1'
defaultCPU='pxa270-c0-arm-cpu' acpi='no'/>
<machine type='tcg' name='spitz' maxCpus='1'
defaultCPU='pxa270-c0-arm-cpu' acpi='no'/>
<machine type='tcg' name='nuri' maxCpus='2'
acpi='no'/>
<machine type='tcg' name='mcimx7d-sabre' maxCpus='2'
defaultRAMid='mcimx7d-sabre.ram' acpi='no'/>
<machine type='tcg' name='romulus-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='npcm750-evb' maxCpus='2'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='rainier-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='mps3-an547' maxCpus='1'
defaultCPU='cortex-m55-arm-cpu' defaultRAMid='DDR' acpi='no'/>
<machine type='tcg' name='musca-b1' maxCpus='2'
defaultCPU='cortex-m33-arm-cpu' acpi='no'/>
<machine type='tcg' name='realview-pbx-a9' maxCpus='4'
defaultCPU='cortex-a9-arm-cpu' acpi='no'/>
<machine type='tcg' name='kzm' maxCpus='1'
defaultRAMid='kzm.ram' acpi='no'/>
<machine type='tcg' name='versatileab' maxCpus='1'
defaultCPU='arm926-arm-cpu' defaultRAMid='versatile.ram'
acpi='no'/>
<machine type='tcg' name='fby35-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='musca-a' maxCpus='2'
defaultCPU='cortex-m33-arm-cpu' acpi='no'/>
<machine type='tcg' name='mcimx6ul-evk' maxCpus='1'
defaultRAMid='mcimx6ul-evk.ram' acpi='no'/>
<machine type='tcg' name='smdkc210' maxCpus='2'
acpi='no'/>
<machine type='tcg' name='sx1' maxCpus='1'
defaultCPU='ti925t-arm-cpu' defaultRAMid='omap1.dram'
acpi='no'/>
<machine type='tcg' name='imx25-pdk' maxCpus='1'
defaultRAMid='imx25.ram' acpi='no'/>
<machine type='tcg' name='stm32vldiscovery' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='orangepi-pc' maxCpus='4'
defaultCPU='cortex-a7-arm-cpu' defaultRAMid='orangepi.ram'
acpi='no'/>
<machine type='tcg' name='quanta-q71l-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='z2' maxCpus='1'
defaultCPU='pxa270-c5-arm-cpu' acpi='no'/>
<machine type='tcg' name='xilinx-zynq-a9' maxCpus='1'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='zynq.ext_ram'
acpi='no'/>
<machine type='tcg' name='xlnx-zcu102' maxCpus='6'
defaultRAMid='ddr-ram' acpi='no'/>
<machine type='tcg' name='tosa' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='mps2-an500' maxCpus='1'
defaultCPU='cortex-m7-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='mps2-an521' maxCpus='2'
defaultCPU='cortex-m33-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='sabrelite' maxCpus='4'
defaultRAMid='sabrelite.ram' acpi='no'/>
<machine type='tcg' name='mps2-an511' maxCpus='1'
defaultCPU='cortex-m3-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='canon-a1100' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='realview-eb' maxCpus='1'
defaultCPU='arm926-arm-cpu' acpi='no'/>
<machine type='tcg' name='quanta-gbs-bmc' maxCpus='2'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='emcraft-sf2' maxCpus='1'
defaultCPU='cortex-m3-arm-cpu' acpi='no'/>
<machine type='tcg' name='realview-pb-a8' maxCpus='1'
defaultCPU='cortex-a8-arm-cpu' acpi='no'/>
<machine type='tcg' name='sbsa-ref' maxCpus='512'
defaultCPU='cortex-a57-arm-cpu' defaultRAMid='sbsa-ref.ram'
acpi='no'/>
<machine type='tcg' name='raspi1ap' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='palmetto-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='sx1-v1' maxCpus='1'
defaultCPU='ti925t-arm-cpu' defaultRAMid='omap1.dram'
acpi='no'/>
<machine type='tcg' name='n810' maxCpus='1'
defaultCPU='arm1136-r2-arm-cpu' defaultRAMid='omap2.dram'
acpi='no'/>
<machine type='tcg' name='g220a-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='n800' maxCpus='1'
defaultCPU='arm1136-r2-arm-cpu' defaultRAMid='omap2.dram'
acpi='no'/>
<machine type='tcg' name='tacoma-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='bletchley-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='quanta-gsj' maxCpus='2'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='versatilepb' maxCpus='1'
defaultCPU='arm926-arm-cpu' defaultRAMid='versatile.ram'
acpi='no'/>
<machine type='tcg' name='terrier' maxCpus='1'
defaultCPU='pxa270-c5-arm-cpu' acpi='no'/>
<machine type='tcg' name='mainstone' maxCpus='1'
defaultCPU='pxa270-c5-arm-cpu' acpi='no'/>
<machine type='tcg' name='realview-eb-mpcore' maxCpus='4'
defaultCPU='arm11mpcore-arm-cpu' acpi='no'/>
<machine type='tcg' name='supermicrox11-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='witherspoon-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='qcom-firework-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='mps3-an524' maxCpus='2'
defaultCPU='cortex-m33-arm-cpu' defaultRAMid='DDR' acpi='no'/>
<machine type='tcg' name='kudo-bmc' maxCpus='2'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='vexpress-a9' maxCpus='4'
defaultCPU='cortex-a9-arm-cpu' defaultRAMid='vexpress.highmem'
acpi='no'/>
<machine type='tcg' name='midway' maxCpus='4'
defaultRAMid='highbank.dram' acpi='no'/>
<machine type='tcg' name='musicpal' maxCpus='1'
defaultCPU='arm926-arm-cpu' defaultRAMid='musicpal.ram'
acpi='no'/>
<machine type='tcg' name='lm3s811evb' maxCpus='1'
defaultCPU='cortex-m3-arm-cpu' acpi='no'/>
<machine type='tcg' name='lm3s6965evb' maxCpus='1'
defaultCPU='cortex-m3-arm-cpu' acpi='no'/>
<machine type='tcg' name='supermicro-x11spi-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='microbit' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='fby35' maxCpus='3'
acpi='no'/>
<machine type='tcg' name='mps2-an505' maxCpus='1'
defaultCPU='cortex-m33-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='mps2-an385' maxCpus='1'
defaultCPU='cortex-m3-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='raspi3ap' maxCpus='4'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='cubieboard' maxCpus='1'
defaultCPU='cortex-a8-arm-cpu' defaultRAMid='cubieboard.ram'
acpi='no'/>
<machine type='tcg' name='ast1030-evb' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='verdex' maxCpus='1'
defaultCPU='pxa270-c0-arm-cpu' acpi='no'/>
<machine type='tcg' name='netduino2' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='xlnx-versal-virt' maxCpus='4'
defaultRAMid='ddr' acpi='no'/>
<machine type='tcg' name='mps2-an386' maxCpus='1'
defaultCPU='cortex-m4-arm-cpu' defaultRAMid='mps.ram'
acpi='no'/>
<machine type='tcg' name='olimex-stm32-h405' maxCpus='1'
defaultCPU='cortex-m4-arm-cpu' acpi='no'/>
<machine type='tcg' name='raspi3b' maxCpus='4'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='raspi2b' maxCpus='4'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='vexpress-a15' maxCpus='4'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='vexpress.highmem'
acpi='no'/>
<machine type='tcg' name='fuji-bmc' maxCpus='2'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='sonorapass-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='cheetah' maxCpus='1'
defaultCPU='ti925t-arm-cpu' defaultRAMid='omap1.dram'
acpi='no'/>
<machine type='tcg' name='ast2500-evb' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='highbank' maxCpus='4'
defaultRAMid='highbank.dram' acpi='no'/>
<machine type='tcg' name='akita' maxCpus='1'
defaultCPU='pxa270-c0-arm-cpu' acpi='no'/>
<machine type='tcg' name='connex' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='netduinoplus2' maxCpus='1'
acpi='no'/>
<machine type='tcg' name='collie' maxCpus='1'
defaultCPU='sa1110-arm-cpu' defaultRAMid='strongarm.sdram'
acpi='no'/>
<machine type='tcg' name='raspi0' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
<machine type='tcg' name='fp5280g2-bmc' maxCpus='1'
defaultRAMid='ram' acpi='no'/>
In contrast to those which do report ACPI:
$ grep machine tests/qemucapabilitiesdata/caps_8.0.0.aarch64.xml | grep
"acpi='yes'"
<machine type='tcg' name='virt-2.7' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-3.0' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-5.0' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-2.10' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-2.8' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-3.1' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-5.1' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-2.11' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-2.9' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-5.2' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-2.12' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-7.0' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-4.0' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-7.1' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-4.1' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-7.2' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-4.2' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-6.0' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-8.0' alias='virt'
maxCpus='512' defaultCPU='cortex-a15-arm-cpu'
defaultRAMid='mach-virt.ram' acpi='yes'/>
<machine type='tcg' name='virt-6.1' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-6.2' maxCpus='512'
defaultCPU='cortex-a15-arm-cpu' defaultRAMid='mach-virt.ram'
acpi='yes'/>
<machine type='tcg' name='virt-2.6' maxCpus='255'
defaultCPU='cortex-a15-arm-cpu' numaMemSupported='yes'
defaultRAMid='mach-virt.ram' acpi='yes'/>
Today we just do this in the QEMU driver:
if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64))
virCapabilitiesAddGuestFeatureWithToggle(guest,
VIR_CAPS_GUEST_FEATURE_TYPE_ACPI,
true, true);
and virt-install/virt-manager look at this to decide whether
to add <acpi/> in the domain XML.
So if we're moving this capability into domain capabilities,
to become per-machine type variable, we'll need code changes
to any apps using the historical capability.
Okay so this then also should be exposed in domain capabilities, because
this series simply deals with formatting it on the commandline, rather
than any discoverability.
The main problem reported as issue is that with ARM if you don't add
'<acpi/>' to the XML we format '-no-acpi' which gets turned into
acpi=off inside qemu and then the commandline parser moans that 'acpi'
property of the machine was not found.
If you try to work it aroud by adding '<acpi/>' to suppress
'-no-acpi'
then in turn libvirt moans that for uusing acpi you need UEFI.