From patchwork Fri Feb 16 02:33:27 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: 10223999 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 0D223601E7 for ; Fri, 16 Feb 2018 02:37:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFA3027F90 for ; Fri, 16 Feb 2018 02:37:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E444E28138; Fri, 16 Feb 2018 02:37:44 +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 B051927F98 for ; Fri, 16 Feb 2018 02:37:43 +0000 (UTC) Received: from localhost ([::1]:57567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVuA-0003vE-TS for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Feb 2018 21:37:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emVqZ-0000rS-Kl for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:34:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emVqY-0004AR-Nu for qemu-devel@nongnu.org; Thu, 15 Feb 2018 21:33:59 -0500 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]:33073) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emVqU-000490-Bw; Thu, 15 Feb 2018 21:33:54 -0500 Received: by mail-pg0-x22b.google.com with SMTP id g12so1355302pgs.0; Thu, 15 Feb 2018 18:33:54 -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; bh=FdZGAfFe6/phe5RzB3OvBOCA7US+1m+AerJ6BhvGLwM=; b=RwjiE50Ub3apy7iEp0nYB2oxBDXz5mbak3B+TmUeWRg+cWzM3tQZQZH1PaLqZ1kIJs Sg65IUCiN4wMHa04IvyF5MeAXv0CyMRjgCdepsWNIS0Ikk94+QOgny/3KVVChwTFi2TS 0ZYxDnBgtwpTFA6q3Td+OXtcKPpSzl295iWKJisAj7dnrYk21ENuC38vkA3K/wpntXY+ Oooj6OJIXto0p7IosGvRxTfQFpgjWheoMkf2YCEdYYwAURl5j1nipfHF+BVo86D4XY7C AG7P9Edx5mt/vwPPMcrm7GixpsNDVLGKehy9XQepoqKpZpS0ZQ0uMGyPcXWUHxi0O2OS xpLQ== 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; bh=FdZGAfFe6/phe5RzB3OvBOCA7US+1m+AerJ6BhvGLwM=; b=cJIGN33Q5jOyme+4swzN1i6j97e1fGqpcyC5ZlWpxAG3xEx56UPFXCJPBgNuZ0gb50 4yR+EqIAzvvpCzeF7E4LnFEhEEGqWqV+23GWCxE16La0DqRRv891XPMkBP+r3YbtG9Bm 9v2TRMl0utr30lXD19DMjG3k0CqVMK7oboHRTN5bPu4bzPwYT3Y/tMjlFCDkEfgLyk3P txCFcQi7JkvAS7ZLprHSXuRafQyGkpG6mptHUqbIG+9hJoZa+JhOBwZJpFK0QVNuBfem jV0JLNDkEFurKyk7fak4Wwzlw71ov/Ut71ILG6En48EJ9xLF4fpsMAKaOqHQAtIUo7pK V0Hg== X-Gm-Message-State: APf1xPDupd98THbIHtTqW3tVs1Z8k7S9DgN1Q16PE9f9477Hbl1FctDW tsCA1vo2jU0/2NF5q1CBON3YPHYp X-Google-Smtp-Source: AH8x226Lk0qFvJBrRg+caB+PoGs+qnc7o2PMxxwfqZW5pyA9rS7a0LXJkvUueMGo782wCbG6XTAeag== X-Received: by 10.99.120.13 with SMTP id t13mr3909407pgc.35.1518748433036; Thu, 15 Feb 2018 18:33:53 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 18:33:52 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Fri, 16 Feb 2018 13:33:27 +1100 Message-Id: <20180216023328.8407-1-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22b Subject: [Qemu-devel] [QEMU-PPC] [PATCH V4 1/2] ppc/spapr-caps: Disallow setting workaround for spapr-cap-ibs 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 The spapr-cap cap-ibs can only have values broken or fixed as there is no explicit workaround required. Currently setting the value workaround for this cap will hit an assert if the guest makes the hcall h_get_cpu_characteristics. Report an error when attempting to apply the setting with a more helpful error message. Reported-by: Satheesh Rajendran Signed-off-by: Suraj Jitindar Singh --- V3 -> V4: - Add this patch back from V1 to replace "ppc/spapr-caps: Convert spapr-cap-ibs to be a boolean" as this was deemed to be a better solution --- hw/ppc/spapr_caps.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index e69d308560..99a4b71d19 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -205,7 +205,9 @@ static void cap_safe_bounds_check_apply(sPAPRMachineState *spapr, uint8_t val, static void cap_safe_indirect_branch_apply(sPAPRMachineState *spapr, uint8_t val, Error **errp) { - if (tcg_enabled() && val) { + if (val == SPAPR_CAP_WORKAROUND) { /* Can only be Broken or Fixed */ + error_setg(errp, "Requested safe indirect branch capability level \"workaround\" not valid, try cap-ibs=fixed"); + } else if (tcg_enabled() && val) { /* TODO - for now only allow broken for TCG */ error_setg(errp, "Requested safe indirect branch capability level not supported by tcg, try a different value for cap-ibs"); } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_indirect_branch())) { @@ -263,7 +265,7 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = { }, [SPAPR_CAP_IBS] = { .name = "ibs", - .description = "Indirect Branch Serialisation" VALUE_DESC_TRISTATE, + .description = "Indirect Branch Serialisation (broken, fixed)", .index = SPAPR_CAP_IBS, .get = spapr_cap_get_tristate, .set = spapr_cap_set_tristate,