Skip to content

Commit

Permalink
hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine
Browse files Browse the repository at this point in the history
A couple of distributors are compiling their distributions
with "-mcpu=power8" for ppc64le these days, so the user sooner
or later runs into a crash there when not explicitely specifying
the "-cpu POWER8" option to QEMU (which is currently using POWER7
for the "pseries" machine by default). Due to this reason, the
linux-user target already switched to POWER8 a while ago (see commit
de3f1b9). Since the softmmu target
of course has the same problem, we should switch there to POWER8 for
the newer machine types, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
huth authored and dgibson committed Oct 6, 2016
1 parent ef6c47f commit 3daa4a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hw/ppc/spapr.c
Expand Up @@ -1775,7 +1775,7 @@ static void ppc_spapr_init(MachineState *machine)

/* init CPUs */
if (machine->cpu_model == NULL) {
machine->cpu_model = kvm_enabled() ? "host" : "POWER7";
machine->cpu_model = kvm_enabled() ? "host" : smc->tcg_default_cpu;
}

ppc_cpu_parse_features(machine->cpu_model);
Expand Down Expand Up @@ -2402,6 +2402,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
mc->cpu_index_to_socket_id = spapr_cpu_index_to_socket_id;

smc->dr_lmb_enabled = true;
smc->tcg_default_cpu = "POWER8";
mc->query_hotpluggable_cpus = spapr_query_hotpluggable_cpus;
fwc->get_dev_path = spapr_get_fw_dev_path;
nc->nmi_monitor_handler = spapr_nmi;
Expand Down Expand Up @@ -2478,7 +2479,10 @@ static void spapr_machine_2_7_instance_options(MachineState *machine)

static void spapr_machine_2_7_class_options(MachineClass *mc)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);

spapr_machine_2_8_class_options(mc);
smc->tcg_default_cpu = "POWER7";
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
}

Expand Down
1 change: 1 addition & 0 deletions include/hw/ppc/spapr.h
Expand Up @@ -39,6 +39,7 @@ struct sPAPRMachineClass {
/*< public >*/
bool dr_lmb_enabled; /* enable dynamic-reconfig/hotplug of LMBs */
bool use_ohci_by_default; /* use USB-OHCI instead of XHCI */
const char *tcg_default_cpu; /* which (TCG) CPU to simulate by default */
};

/**
Expand Down

0 comments on commit 3daa4a9

Please sign in to comment.