[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/30] ppc/prep: Report an error when run with KVM
From: |
Cédric Le Goater |
Subject: |
[PULL 06/30] ppc/prep: Report an error when run with KVM |
Date: |
Mon, 26 Jun 2023 07:56:23 +0200 |
The 'prep' machine never supported KVM. This piece of code was
probably inherited from another model.
Cc: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/prep.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 33bf232f8b0d..d9231c731775 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -45,7 +45,6 @@
#include "trace.h"
#include "elf.h"
#include "qemu/units.h"
-#include "kvm_ppc.h"
/* SMP is not enabled, for now */
#define MAX_CPUS 1
@@ -245,6 +244,12 @@ static void ibm_40p_init(MachineState *machine)
long kernel_size = 0, initrd_size = 0;
char boot_device;
+ if (kvm_enabled()) {
+ error_report("machine %s does not support the KVM accelerator",
+ MACHINE_GET_CLASS(machine)->name);
+ exit(EXIT_FAILURE);
+ }
+
/* init CPU */
cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;
@@ -392,18 +397,7 @@ static void ibm_40p_init(MachineState *machine)
fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);
fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);
- fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled());
- if (kvm_enabled()) {
- uint8_t *hypercall;
-
- fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, kvmppc_get_tbfreq());
- hypercall = g_malloc(16);
- kvmppc_get_hypercall(env, hypercall, 16);
- fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16);
- fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid());
- } else {
- fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, NANOSECONDS_PER_SECOND);
- }
+ fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, NANOSECONDS_PER_SECOND);
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, boot_device);
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
--
2.41.0
- [PULL 00/30] ppc queue, Cédric Le Goater, 2023/06/26
- [PULL 01/30] target/ppc: gdbstub init spr gdb_id for all CPUs, Cédric Le Goater, 2023/06/26
- [PULL 03/30] MAINTAINERS: Add reviewers for PowerNV baremetal emulation, Cédric Le Goater, 2023/06/26
- [PULL 02/30] ppc/pnv/pci: Clean up error messages, Cédric Le Goater, 2023/06/26
- [PULL 05/30] MAINTAINERS: Add reviewer for XIVE, Cédric Le Goater, 2023/06/26
- [PULL 04/30] MAINTAINERS: Add reviewer for PowerPC TCG CPUs, Cédric Le Goater, 2023/06/26
- [PULL 07/30] ppc/bamboo: Report an error when run with KVM, Cédric Le Goater, 2023/06/26
- [PULL 06/30] ppc/prep: Report an error when run with KVM,
Cédric Le Goater <=
- [PULL 08/30] ppc/pnv: Rephrase error when run with KVM, Cédric Le Goater, 2023/06/26
- [PULL 11/30] ppc/spapr: Add a nested state struct, Cédric Le Goater, 2023/06/26
- [PULL 09/30] target/ppc: Fix timer register accessors when !KVM, Cédric Le Goater, 2023/06/26
- [PULL 10/30] ppc/spapr: H_ENTER_NESTED should restore host XER ca field, Cédric Le Goater, 2023/06/26
- [PULL 13/30] ppc/spapr: Move spapr nested HV to a new file, Cédric Le Goater, 2023/06/26
- [PULL 17/30] target/ppc: Implement HEIR SPR, Cédric Le Goater, 2023/06/26
- [PULL 14/30] target/ppc: Fix instruction loading endianness in alignment interrupt, Cédric Le Goater, 2023/06/26