From patchwork Wed Oct 5 07:44:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9362577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 28E6B607D6 for ; Wed, 5 Oct 2016 07:47:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CF442868C for ; Wed, 5 Oct 2016 07:47:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11C56286A0; Wed, 5 Oct 2016 07:47:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0F352868C for ; Wed, 5 Oct 2016 07:47:33 +0000 (UTC) Received: from localhost ([::1]:46989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brgvM-00080L-VN for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Oct 2016 03:47:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brgsr-0006b9-7T for qemu-devel@nongnu.org; Wed, 05 Oct 2016 03:45:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brgsp-0003mY-6j for qemu-devel@nongnu.org; Wed, 05 Oct 2016 03:44:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brgsp-0003mR-14; Wed, 05 Oct 2016 03:44:55 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7960CE0374; Wed, 5 Oct 2016 07:44:54 +0000 (UTC) Received: from thh440s.str.redhat.com. (dhcp-192-218.str.redhat.com [10.33.192.218]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u957iqi9020106; Wed, 5 Oct 2016 03:44:53 -0400 From: Thomas Huth To: David Gibson , qemu-ppc@nongnu.org Date: Wed, 5 Oct 2016 09:44:51 +0200 Message-Id: <1475653491-8611-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 05 Oct 2016 07:44:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] hw/ppc/spapr: Use POWER8 by default for the pseries-2.8 machine X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 */ }; /**