From patchwork Wed Feb 14 04:12:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 10218033 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 818A9605BA for ; Wed, 14 Feb 2018 04:15:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73B8B28973 for ; Wed, 14 Feb 2018 04:15:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67109289EC; Wed, 14 Feb 2018 04:15:08 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 ED45628992 for ; Wed, 14 Feb 2018 04:15:07 +0000 (UTC) Received: from localhost ([::1]:32997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eloTK-00039W-Vq for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Feb 2018 23:15:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eloRb-0001aN-I3 for qemu-devel@nongnu.org; Tue, 13 Feb 2018 23:13:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eloRa-0007Sp-Ex for qemu-devel@nongnu.org; Tue, 13 Feb 2018 23:13:19 -0500 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:35275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eloRX-0007Pu-JY; Tue, 13 Feb 2018 23:13:15 -0500 Received: by mail-pl0-x243.google.com with SMTP id o11so4223835pls.2; Tue, 13 Feb 2018 20:13:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9dU8U27KPcUaUdrr7LrQ4Zj+87dpE8oWChWrzaJKw6g=; b=bItVs5Ocom49ioJeZ8MrGatcta+2kAf/9QxiWqo8mMo/a93JKoaZMy9ZiOsdenCoG8 J5mzwYPdwOmjIsAdtx6OgJPYIbk1iJz2Q1ZTL1TdFguLwqrHiZKd/w3wbUPXap3HP8n2 slJYoGzafGxYhjx319/RWENG5ZKbMEaLS9kT3CLvt6UIawyY0bt4rsW17laCjADmq/f8 QtAIhvPPZunJzK5AINoPjKJZcbnz+hA4dJ9JHsVcbIelIgbw6aEvk2KAy+jOdadPOj8N U4C9to8p8dDiGRSQKmngMCDAdt3TSSsSHI/1VpdIKTM93/kvYPAgVRP45D2SnZbhHOD6 7y9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9dU8U27KPcUaUdrr7LrQ4Zj+87dpE8oWChWrzaJKw6g=; b=XHmw+R38O/doNCV22TMiI5ZTOdA+O4tYtyBF596hfWYlTSL7YC3zGfaj10oKQOaXmD imBotevUbLGFgFrezOyNMg4uNmGKhqCFssArvBybK8sJLLMBnAziT6oZHXAfH3QfOPV6 g3Rj8hTSXTUBBMcGPTxen/MOqKXtTJmHa+1VZg/Wq/EYlTE6M7wnAvesfFpMv+1HOeeW uxKBx7Xzn02kDarnU3qPf8DCSjQ2pJD7wv6LOzqkw6fHyQ3HA4k3QVa2V7NVG2WdLi2g m54oX9bp3B0dQdR9LkGxwENEDxCRp6FBuW+/WV2o6cUo0tbetOfuy+xAt6OSx4B91z2O DRvw== X-Gm-Message-State: APf1xPAbZKsDXLHtxds9YGVjmb+QlZszK4n1KBMTKy1OqiyRyivUbka1 VdT19b4kqNCaM2UgBJfkpC3osXCm X-Google-Smtp-Source: AH8x225lIiomWM3KaP9pG4/b+4iA63uus7YKuKmtxrHNz3WW5Osw9BMBOFWOj6Brl7J9UGZ/jpdzuA== X-Received: by 2002:a17:902:658f:: with SMTP id c15-v6mr3188251plk.412.1518581594656; Tue, 13 Feb 2018 20:13:14 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id p20sm29761960pfh.100.2018.02.13.20.13.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 20:13:14 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Wed, 14 Feb 2018 15:12:56 +1100 Message-Id: <20180214041256.25473-3-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180214041256.25473-1-sjitindarsingh@gmail.com> References: <20180214041256.25473-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::243 Subject: [Qemu-devel] [QEMU-PPC PATCH 3/3] ppc/spapr-caps: For pseries-2.12 change spapr-cap defaults 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: aik@ozlabs.ru, qemu-devel@nongnu.org, Suraj Jitindar Singh , david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP For the pseries-2.12 machine type, make the spapr-caps SPAPR_CAP_CFPC and SPAPR_CAP_SBBC default to workaround. This means the guest will be able to take advantage of these workarounds by default, so long as the host is capable. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr.c | 11 ++++++++++- hw/ppc/spapr_caps.c | 10 ++++++++++ include/hw/compat.h | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 32a876be56..cd4a024660 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3941,13 +3941,20 @@ static const TypeInfo spapr_machine_info = { /* * pseries-2.12 */ +#define SPAPR_COMPAT_2_12 \ + HW_COMPAT_2_12 + static void spapr_machine_2_12_instance_options(MachineState *machine) { } static void spapr_machine_2_12_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_12); } DEFINE_SPAPR_MACHINE(2_12, "2.12", true); @@ -3969,6 +3976,8 @@ static void spapr_machine_2_11_class_options(MachineClass *mc) spapr_machine_2_12_class_options(mc); smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN; SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_11); } diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 1cd73b617f..3dda1db812 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -283,11 +283,21 @@ static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, caps = smc->default_caps; + if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, + 0, spapr->max_compat_pvr)) { + caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN; + } + if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_07, 0, spapr->max_compat_pvr)) { caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF; } + if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_06_PLUS, + 0, spapr->max_compat_pvr)) { + caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN; + } + if (!ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_2_06, 0, spapr->max_compat_pvr)) { caps.caps[SPAPR_CAP_VSX] = SPAPR_CAP_OFF; diff --git a/include/hw/compat.h b/include/hw/compat.h index 7f31850dfa..13238239da 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,6 +1,8 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H +#define HW_COMPAT_2_12 + #define HW_COMPAT_2_11 \ {\ .driver = "hpet",\