]> Git Repo - qemu.git/commitdiff
ppc/pnv.c: add a friendly warning when accel=kvm is used
authorDaniel Henrique Barboza <[email protected]>
Fri, 17 Dec 2021 16:57:13 +0000 (17:57 +0100)
committerCédric Le Goater <[email protected]>
Fri, 17 Dec 2021 16:57:13 +0000 (17:57 +0100)
If one tries to use -machine powernv9,accel=kvm in a Power9 host, a
cryptic error will be shown:

qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only "-cpu host" is possible
qemu-system-ppc64: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

Appending '-cpu host' will throw another error:

qemu-system-ppc64: invalid chip model 'host' for powernv9 machine

The root cause is that in IBM PowerPC we have different specs for the bare-metal
and the guests. The bare-metal follows OPAL, the guests follow PAPR. The kernel
KVM modules presented in the ppc kernels implements PAPR. This means that we
can't use KVM accel when using the powernv machine, which is the emulation of
the bare-metal host.

All that said, let's give a more informative error in this case.

Signed-off-by: Daniel Henrique Barboza <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Message-Id: <20211130133153[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
hw/ppc/pnv.c

index 71e45515f1362987f1d00bdc35a82ca703cef23c..e5b87e873095a33abe90767631af940dc5048b97 100644 (file)
@@ -742,6 +742,11 @@ static void pnv_init(MachineState *machine)
     DriveInfo *pnor = drive_get(IF_MTD, 0, 0);
     DeviceState *dev;
 
+    if (kvm_enabled()) {
+        error_report("The powernv machine does not work with KVM acceleration");
+        exit(EXIT_FAILURE);
+    }
+
     /* allocate RAM */
     if (machine->ram_size < mc->default_ram_size) {
         char *sz = size_to_str(mc->default_ram_size);
This page took 0.029081 seconds and 4 git commands to generate.