From patchwork Fri Feb 16 02:33:28 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: 10224001 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 C6404601E7 for ; Fri, 16 Feb 2018 02:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5482288B4 for ; Fri, 16 Feb 2018 02:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9442288EA; Fri, 16 Feb 2018 02:38:01 +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 5065D28883 for ; Fri, 16 Feb 2018 02:38:01 +0000 (UTC) Received: from localhost ([::1]:57571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVuS-00048D-KV for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 21:38:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVqa-0000sY-O7 for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:34:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVqZ-0004Am-Ro for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:34:00 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:40358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVqW-00049i-UX; Thu, 15 Feb 2018 21:33:57 -0500 Received: by mail-pg0-x241.google.com with SMTP id g2so1338257pgn.7; Thu, 15 Feb 2018 18:33:56 -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=UAbmF1k7faaXvjPrMPcJuAnWTgS9R7cfy/h04sofZT4=; b=BaP0n4bwTj+hsA1qy3yUyssYmIe9kxgI/qoiwTSbqD4QdXwfEx9lJqEGtzQHocDmL2 v9a9s98Cm4JeuPSLUgbuYXnLO1XtBGJqaVbp7j2ELSN2dD4u2aB9AeiNBjuQa72wsjz8 AwdTU5oSp20IPE9Iasrj8AFJBXcCMhea1xRKbX/wBSwmWSLiKV+FsS02v4p/AG0BsJAL +U2TtpSCZ0Bc2Mdwtkb1JrQdradzAzXbpfvkDPVLcqJFhaLPeeEQd3vwYcFbITMKewx8 Klth0fY91wuuBzcBRBZKGF1hGzk2xHqjfSOxJhQ0Ym+gBmChSHna/iRvR/v9QDg0BWtl R0Bw== 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=UAbmF1k7faaXvjPrMPcJuAnWTgS9R7cfy/h04sofZT4=; b=Y80gmLCSNHkcxcZyT3WmJvTaEVfGvjYBGf592O/scrxrYnxhTPDLOXohLiRkXBdUv0 kzu+9TWkHkSLbeSLZ0WdHd2ZWVlGy2egeeaAk4BzY384pUgAz8WsyO3ZZ9xl+ZpmZSSh sAjQC6b0CAeu/k5Qz+l4IjsDEDcLWtdScBvhLlKQtpkH5FyIpkDzbh76UlVYAhUh1oGW pfN66nkW6DQtiTreRZnOooM0VifUcUbY/0Fbq1g+zIvj4Ua5/gWMTw3KxPUiUiBmjSw6 pvmdrsaAacR1U3o8bXK0q9ADF5VLjI24r+gZnp0bK07p3GgBHCd/acKybN1D7S93cPRK EOlw== X-Gm-Message-State: APf1xPDbfqLECVDOGV9kpaXVW6Ez/YeJ2U2/PsT46i4TEeUgk1G4tfsV ipS3RsTsVhl1FT3s63uv0XIY4uEU X-Google-Smtp-Source: AH8x225TqRhq30TpZKcZpV2wBYf4Tzj3B9m/q2n4u3SRAl6anBTZ/UHT6NVrWjQ2N1rcZ1rj5S8I0g== X-Received: by 10.101.72.198 with SMTP id o6mr3811933pgs.279.1518748435868; Thu, 15 Feb 2018 18:33:55 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id f80sm49659594pff.81.2018.02.15.18.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 18:33:55 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 16 Feb 2018 13:33:28 +1100 Message-Id: <20180216023328.8407-2-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180216023328.8407-1-sjitindarsingh@gmail.com> References: <20180216023328.8407-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 V4 2/2] 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: groug@kaod.org, 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 83c9d66dd5..69f59aabf1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3915,8 +3915,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_BROKEN; spapr_caps_add_properties(smc, &error_abort); } @@ -4000,6 +4000,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 99a4b71d19..7b0ecb3eca 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;