Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ppc/bamboo: Report an error when run with KVM
The 'bamboo' machine was used as a KVM platform in the early days (~2008).
It clearly doesn't support it anymore.

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>
  • Loading branch information
legoater committed Jun 25, 2023
1 parent 9df480d commit 74b2fd6
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions hw/ppc/ppc440_bamboo.c
Expand Up @@ -19,7 +19,6 @@
#include "hw/pci/pci.h"
#include "hw/boards.h"
#include "sysemu/kvm.h"
#include "kvm_ppc.h"
#include "sysemu/device_tree.h"
#include "hw/loader.h"
#include "elf.h"
Expand Down Expand Up @@ -97,16 +96,6 @@ static int bamboo_load_device_tree(MachineState *machine,
fprintf(stderr, "couldn't set /chosen/bootargs\n");
}

/*
* Copy data from the host device tree into the guest. Since the guest can
* directly access the timebase without host involvement, we must expose
* the correct frequencies.
*/
if (kvm_enabled()) {
tb_freq = kvmppc_get_tbfreq();
clock_freq = kvmppc_get_clockfreq();
}

qemu_fdt_setprop_cell(fdt, "/cpus/cpu@0", "clock-frequency",
clock_freq);
qemu_fdt_setprop_cell(fdt, "/cpus/cpu@0", "timebase-frequency",
Expand Down Expand Up @@ -175,6 +164,12 @@ static void bamboo_init(MachineState *machine)
int success;
int i;

if (kvm_enabled()) {
error_report("machine %s does not support the KVM accelerator",
MACHINE_GET_CLASS(machine)->name);
exit(EXIT_FAILURE);
}

cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;

Expand Down

0 comments on commit 74b2fd6

Please sign in to comment.