* [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine
@ 2016-10-05 7:44 Thomas Huth
2016-10-06 0:00 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2016-10-05 7:44 UTC (permalink / raw)
To: David Gibson, qemu-ppc; +Cc: Alexander Graf, qemu-devel
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
de3f1b98410e0d5b406a0df3a48547b559d18602). 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>
---
v2:
- Initialize tcg_default_cpu = "POWER8" in spapr_machine_class_init()
Note: This patch should be applied on top of David's ppc-for-2.8
tree, since the pseries-2.8 machine has just been added there
recently.
hw/ppc/spapr.c | 6 +++++-
include/hw/ppc/spapr.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 63b6a0d..03e3803 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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);
@@ -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;
@@ -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);
}
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 6289d50..39dadaa 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -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 */
};
/**
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine
2016-10-05 7:44 [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine Thomas Huth
@ 2016-10-06 0:00 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2016-10-06 0:00 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-ppc, Alexander Graf, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 3055 bytes --]
On Wed, Oct 05, 2016 at 09:44:51AM +0200, Thomas Huth wrote:
> 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
> de3f1b98410e0d5b406a0df3a48547b559d18602). 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>
> ---
> v2:
> - Initialize tcg_default_cpu = "POWER8" in spapr_machine_class_init()
>
> Note: This patch should be applied on top of David's ppc-for-2.8
> tree, since the pseries-2.8 machine has just been added there
> recently.
>
> hw/ppc/spapr.c | 6 +++++-
> include/hw/ppc/spapr.h | 1 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
Applied to ppc-for-2.8.
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 63b6a0d..03e3803 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -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);
> @@ -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;
> @@ -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);
> }
>
> diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
> index 6289d50..39dadaa 100644
> --- a/include/hw/ppc/spapr.h
> +++ b/include/hw/ppc/spapr.h
> @@ -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 */
> };
>
> /**
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-06 2:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-05 7:44 [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine Thomas Huth
2016-10-06 0:00 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).