ppc/pnv.c: add a friendly warning when accel=kvm is used
PATCH 1/1 ppc/pnv.c: add a friendly warning when accel=kvm is used
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.
--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/ppc/pnv.c +5 -0
@@ -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);
Signature · 1 line
2.31.1
Quoted 28 lines · Daniel Henrique Barboza
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_vcpufailed (0): Invalid argumentAppending '-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]>--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)hw/ppc/pnv.c +0
-0
hw/ppc/pnv.c static void pnv_init(MachineState *machine) · line 748
Quoted 7 lines
hw/ppc/pnv.c +4
-0@@ -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 ); + }
Hmm.. my only concern here is that powernv could, at least theoretically, work with KVM PR. I don't think it does right now, though.
Quoted 4 lines
hw/ppc/pnv.c +1
-0+/* allocate RAM */ if (machine->ram_size < mc->default_ram_size) {char *sz =size_to_str (mc->default_ram_size);
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 32 lines · David Gibson
Quoted 31 lines · Daniel Henrique Barboza
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_vcpufailed (0): Invalid argumentAppending '-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]>--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)hw/ppc/pnv.c +0
-0@@ -742,6 +742,11 @@ static void pnv_init(MachineState *machine)DriveInfo *pnor =drive_get (IF_MTD ,0 ,0 );DeviceState *dev;
Quoted 9 lines
hw/ppc/pnv.c static void pnv_init(MachineState *machine) · line 748
Quoted 4 lines
hw/ppc/pnv.c +4
-0+if (kvm_enabled ()) { +error_report ("The powernv machine does not work with KVM acceleration" ); +exit (EXIT_FAILURE ); + }Hmm.. my only concern here is that powernv could, at least theoretically, work with KVM PR. I don't think it does right now, though.
At the same time, it is nice to not let the user think that it could work in its current state. Don't you think so ?
C.
Quoted 6 lines
Quoted 5 lines
hw/ppc/pnv.c +1
-0+/* allocate RAM */ if (machine->ram_size < mc->default_ram_size) {char *sz =size_to_str (mc->default_ram_size);
Quoted 42 lines · Cédric le Goater
Quoted 24 lines · David Gibson
Quoted 23 lines · Daniel Henrique Barboza
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_vcpufailed (0): Invalid argumentAppending '-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]>--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)Quoted 16 lines
hw/ppc/pnv.c static void pnv_init(MachineState *machine) · line 747
Quoted 11 lines
hw/ppc/pnv.c +4
-0@@ -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 ); + }Hmm.. my only concern here is that powernv could, at least theoretically, work with KVM PR. I don't think it does right now, though.
Quoted 2 lines
At the same time, it is nice to not let the user think that it could work in its current state. Don't you think so ?
Right, I'm thinking of the implication if you have an old qemu but a new KVM which let it work. Chances of KVM actually implementing this probably aren't good though, so requiring the qemu update if we ever do is probably the better deal.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 43 lines · David Gibson
Quoted 42 lines · Cédric le Goater
Quoted 40 lines · David Gibson
Quoted 28 lines · Daniel Henrique Barboza
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_vcpufailed (0): Invalid argumentAppending '-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]>--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)hw/ppc/pnv.c +0
-0hw/ppc/pnv.c static void pnv_init(MachineState *machine) · line 747
Quoted 6 lines
hw/ppc/pnv.c +4
-0@@ -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 ); + }Hmm.. my only concern here is that powernv could, at least theoretically, work with KVM PR. I don't think it does right now, though.
Quoted 7 lines
Quoted 2 lines
At the same time, it is nice to not let the user think that it could work in its current state. Don't you think so ?
Right, I'm thinking of the implication if you have an old qemu but a new KVM which let it work. Chances of KVM actually implementing this probably aren't good though, so requiring the qemu update if we ever do is probably the better deal.
If the KVM module implements powernv accel support in the future, I wouldn't take my the chances with the powernv machine working out of the box with it.
Most likely, if an endeavor of supporting KVM accel for powernv ever takes place, we'll need QEMU changes to go with it. And when that happens we can revert this patch and make the other necessary changes/fixes.
All that said, perhaps it's useful to add a note in docs/system/ppc/powernv.rst explaining the the rationale for what we're doing here.
Thanks,
Daniel
Quoted 1 line
Quoted 58 lines · Daniel Henrique Barboza
Quoted 43 lines · David Gibson
Quoted 42 lines · Cédric le Goater
Quoted 40 lines · David Gibson
Quoted 28 lines · Daniel Henrique Barboza
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_vcpufailed (0): Invalid argumentAppending '-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]>--- hw/ppc/pnv.c | 5 +++++ 1 file changed, 5 insertions(+)hw/ppc/pnv.c +0
-0hw/ppc/pnv.c static void pnv_init(MachineState *machine) · line 747
Quoted 6 lines
hw/ppc/pnv.c +4
-0@@ -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 ); + }Hmm.. my only concern here is that powernv could, at least theoretically, work with KVM PR. I don't think it does right now, though.
Quoted 7 lines
Quoted 2 lines
At the same time, it is nice to not let the user think that it could work in its current state. Don't you think so ?
Right, I'm thinking of the implication if you have an old qemu but a new KVM which let it work. Chances of KVM actually implementing this probably aren't good though, so requiring the qemu update if we ever do is probably the better deal.
If the KVM module implements powernv accel support in the future, I wouldn't take my the chances with the powernv machine working out of the box with it.
Quoted 6 lines
Most likely, if an endeavor of supporting KVM accel for powernv ever takes place, we'll need QEMU changes to go with it. And when that happens we can revert this patch and make the other necessary changes/fixes.
All that said, perhaps it's useful to add a note in
docs/system/ppc/powernv.rstexplaining the the rationale for what we're doing here.
Yeah, makes sense to me.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson