[PATCH 5/9] ppc/pegasos2: Report an error when run with KVM

Cédric Le Goater posted 9 patches 2 years, 7 months ago
Maintainers: BALATON Zoltan <balaton@eik.bme.hu>, "Cédric Le Goater" <clg@kaod.org>, "Frédéric Barrat" <fbarrat@linux.ibm.com>, Nicholas Piggin <npiggin@gmail.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH 5/9] ppc/pegasos2: Report an error when run with KVM
Posted by Cédric Le Goater 2 years, 7 months ago
The 'pegasos2' machine never supported KVM. This piece of code was
inherited from another model.

Cc: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/pegasos2.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index af5489de26ed..830323cc7849 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -29,7 +29,6 @@
 #include "qemu/log.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
-#include "kvm_ppc.h"
 #include "exec/address-spaces.h"
 #include "qom/qom-qobject.h"
 #include "qapi/qmp/qdict.h"
@@ -120,6 +119,12 @@ static void pegasos2_init(MachineState *machine)
     int i, sz;
     uint8_t *spd_data;
 
+    if (kvm_enabled()) {
+        error_report("machine %s does not support the KVM accelerator",
+                     MACHINE_GET_CLASS(machine)->name);
+        exit(EXIT_FAILURE);
+    }
+
     /* init CPU */
     pm->cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
     env = &pm->cpu->env;
-- 
2.41.0


Re: [PATCH 5/9] ppc/pegasos2: Report an error when run with KVM
Posted by BALATON Zoltan 2 years, 7 months ago
On Tue, 20 Jun 2023, Cédric Le Goater wrote:
> The 'pegasos2' machine never supported KVM. This piece of code was
> inherited from another model.

Why? These machines are supposed to run with KVM they were just not tested 
yet. I think pegasos2 should work on a G4 host with KVM-PR but you need to 
use the firmware rom for -bios now because VOF uses sc 1 which will not 
work with KVM on G4, it's only supported with TCG. (I plan to solve this 
eventually when needed by replacing that with another hypercall method 
such as OSI used by MOL but that would need two vof binaries or carry 
some unneeded code if using single binary.)

So please drop this patch.

Regards,
BALATON Zoltan

> Cc: BALATON Zoltan <balaton@eik.bme.hu>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> hw/ppc/pegasos2.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
> index af5489de26ed..830323cc7849 100644
> --- a/hw/ppc/pegasos2.c
> +++ b/hw/ppc/pegasos2.c
> @@ -29,7 +29,6 @@
> #include "qemu/log.h"
> #include "qemu/error-report.h"
> #include "sysemu/kvm.h"
> -#include "kvm_ppc.h"
> #include "exec/address-spaces.h"
> #include "qom/qom-qobject.h"
> #include "qapi/qmp/qdict.h"
> @@ -120,6 +119,12 @@ static void pegasos2_init(MachineState *machine)
>     int i, sz;
>     uint8_t *spd_data;
>
> +    if (kvm_enabled()) {
> +        error_report("machine %s does not support the KVM accelerator",
> +                     MACHINE_GET_CLASS(machine)->name);
> +        exit(EXIT_FAILURE);
> +    }
> +
>     /* init CPU */
>     pm->cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
>     env = &pm->cpu->env;
>
Re: [PATCH 5/9] ppc/pegasos2: Report an error when run with KVM
Posted by Richard Henderson 2 years, 7 months ago
On 6/20/23 07:59, Cédric Le Goater wrote:
> The 'pegasos2' machine never supported KVM. This piece of code was
> inherited from another model.
> 
> Cc: BALATON Zoltan<balaton@eik.bme.hu>
> Signed-off-by: Cédric Le Goater<clg@kaod.org>
> ---
>   hw/ppc/pegasos2.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~