From patchwork Thu Feb 15 00:44:43 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: 10220183 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 1C56460467 for ; Thu, 15 Feb 2018 00:49:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B1AF286CA for ; Thu, 15 Feb 2018 00:49:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 000D628C79; Thu, 15 Feb 2018 00:49:11 +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 90951286CA for ; Thu, 15 Feb 2018 00:49:11 +0000 (UTC) Received: from localhost ([::1]:49161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em7ja-0006Uf-TG for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Feb 2018 19:49:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em7fp-0003Yk-8X for qemu-devel@nongnu.org; Wed, 14 Feb 2018 19:45:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em7fo-0005Sp-EP for qemu-devel@nongnu.org; Wed, 14 Feb 2018 19:45:17 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:45878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em7fm-0005QW-4r; Wed, 14 Feb 2018 19:45:14 -0500 Received: by mail-pg0-x241.google.com with SMTP id e11so2932109pgq.12; Wed, 14 Feb 2018 16:45:13 -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=Cfrac01NiOC5YGZllnSn4YATwaRFFlIQKYZntAAwABo=; b=UmQ4loBq8uDtT4JVOO6vWkfIHr/teLuk2bJmIvnvQhIR/nBmDt/8oB3rIeQHcOg2tq PojI2oYWddbrJa+Z/nVX8MM6kxE2ZpnTCA4FOiF7Y4HAJ40UriHhNzgOkSXFcReeRVVr UizKGbip4dO0FKJcdpfULvrNaNvS2cIVA8sOqQp8mV19fYA10fPCbaqMziTSBaMsQOF5 Z8LJps1hjuj0Ir0BfGUN7g/z7sCY/ZENlUXs+dUYTY5Gxs9/wJ9A+6I1hn4MuBOmpj+3 PxN7bt5nZ0cKvdjjPAUoOTQiCjXxullmGHPo3YVCpG8yKb6vjhEZjXwYZmPsiJB2hUgC pxHA== 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=Cfrac01NiOC5YGZllnSn4YATwaRFFlIQKYZntAAwABo=; b=ZTSavDpitgGkf57BaQfdFBjdnaW/+vagbNa9SIWZaFdI8HaBRaeX2LybcYhc6fI+z9 00H3xZoq3YYE9bp7ttw4pkS9WNcPf5BilumGa2fEvsZoaCw36IWFC3kMWZ2eV2ZpDhDZ GS8pAPXbSvgMHxhuhwXffe/653mfeL8QPA+xoqC6MUKQ1eZwR7zjBNjgcI46QlD50/dN d1qtV6h9IiGvpY5JIRSSdEnu9tgnXURaMsilFiFZIN8dfXAzQPmBthOxaf0NzNw06DrK eRrVPAwKU1ZaqX8sR5PYLSy05FEb2wObrs3+beRN0Ae+wRkaWwX0gz2asReqVlF7PMh9 +kzQ== X-Gm-Message-State: APf1xPCLdBOf6CfrZxAC8FwTuB1jzhrLOgK6HkAejTBdQnHBvSwGYdNf lFR7TB/ZTOIzhho0K0ZgPXy6JHfq X-Google-Smtp-Source: AH8x224E54MJrV1FGKO3+7Ji3XdTlmOIpdbu/7+JTiGL3SOshe1E7EVLSuldH3YIqvQpzYgowryVng== X-Received: by 10.101.83.76 with SMTP id w12mr655206pgr.95.1518655513054; Wed, 14 Feb 2018 16:45:13 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u85sm12226660pfi.80.2018.02.14.16.45.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 16:45:12 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Thu, 15 Feb 2018 11:44:43 +1100 Message-Id: <20180215004443.18013-3-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180215004443.18013-1-sjitindarsingh@gmail.com> References: <20180215004443.18013-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 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. Thus if the host is capable the guest will be able to take advantage of these workarounds by default. Otherwise if the host doesn't have these capabilities qemu will fail to start and they will have to be explicitly disabled on the command line with: -machine pseries,cap-cfpc=broken,cap-sbbc=broken Signed-off-by: Suraj Jitindar Singh --- V2 -> V3: - Set caps to workaround in the class default rather than the pseries-2.12 initialiser. --- hw/ppc/spapr.c | 6 ++++-- hw/ppc/spapr_caps.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 969db6cde2..4fe2c3b90c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3884,8 +3884,8 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_OFF; smc->default_caps.caps[SPAPR_CAP_VSX] = SPAPR_CAP_ON; smc->default_caps.caps[SPAPR_CAP_DFP] = SPAPR_CAP_ON; - smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN; - smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN; + smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; + smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_OFF; spapr_caps_add_properties(smc, &error_abort); } @@ -3969,6 +3969,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 05997b0842..c25c2bca52 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -281,11 +281,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;