From patchwork Wed Feb 14 04:12:55 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: 10218031 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 360D46055C 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 28D3528973 for ; Wed, 14 Feb 2018 04:15:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CC6A289F9; 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 AF4C328973 for ; Wed, 14 Feb 2018 04:15:07 +0000 (UTC) Received: from localhost ([::1]:32998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eloTK-0003AN-Rw for patchwork-qemu-devel@patchwork.kernel.org; Tue, 13 Feb 2018 23:15:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eloRb-0001a7-70 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-0007Sf-Cu for qemu-devel@nongnu.org; Tue, 13 Feb 2018 23:13:19 -0500 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:35274) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eloRU-0007KQ-Sa; Tue, 13 Feb 2018 23:13:12 -0500 Received: by mail-pl0-x242.google.com with SMTP id o11so4223759pls.2; Tue, 13 Feb 2018 20:13:12 -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=qD6HxLsJkzhWCFCkDqbK/U2qQGcP/qavf1gRri1L4pc=; b=RPSA7S0vgrYST883pGXae3UCavyMZdiqmHhe2M+3m7L3jIfobe2P0dr3EXihYiYdf4 nMA5ZJ3EJezSeIXgkeQiq7fZs9+cs6UD3lmW6DtjR3JvHn4HLrQmFJlWnwutsXAPMXnw y9y2c5FxWyf9DZxLYhvvtAaTiqyUydhCHn9ELEy6bzYtfc63debsV0937n8iBbtv6WCm WuEREmqQ6oASXrG26eXtF0TxprwPWBqhuFBeXECuzb6AlFqIss3ib/mtJrrBQAbiLKpf a45ZvYVSQA7LuF+fyyBcvnJ3FmNScxbtKi8oMwNSJ32oPF5aBxSqjP2mc/4w/emIfYRm JqMQ== 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=qD6HxLsJkzhWCFCkDqbK/U2qQGcP/qavf1gRri1L4pc=; b=BfjPTIYorujwimBfoHNlI4YBdWm4hOIgoeAA3Q7jZPioiAPqValnCmmKlrlPeKmvL4 LzSba6phVZl1WzDV/oAMJW0klPzi8EoTeXaqXLZTQLI6UrCJsq7Rovw57NqvXOzgob1v Okiszytq38jyPtPDIS850hTAv1A4i2LmQ+rLMpx552mXIOv56CyzENBUvMbh51ng+ulp g17FVEGyIj2WOID90p77QmqGrOxjk51mIjF+7iawVmN9460Dt0gFdJRgFUphopKk/pLn PceqDD4O0yeOdNxxCSXPzSxVadr4PDgeMncIby1OzxeFaBhfG4wmb2VPvL3sKZS2VNSq H3fQ== X-Gm-Message-State: APf1xPDwUMAyiPLN3U00f+1DE0NnJSfpZJ6LYui2jcUIT5D7rI7DY79U gi7wUP1S+5n2+RJLKmtiWZTDGIG8 X-Google-Smtp-Source: AH8x2248OOryi8/EhMQmfxiOq4znKhO8xJJU7Dp3kv+uVO2XUjbOnUlEs6x/qVTD3yropqV0O/jUBw== X-Received: by 2002:a17:902:b417:: with SMTP id x23-v6mr3213995plr.339.1518581591877; Tue, 13 Feb 2018 20:13:11 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 20:13:11 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Wed, 14 Feb 2018 15:12:55 +1100 Message-Id: <20180214041256.25473-2-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::242 Subject: [Qemu-devel] [QEMU-PPC PATCH 2/3] 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: 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 The spapr-cap cap-ibs can only have values broken or fixed as there is no workaround. Currently setting the value workaround 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 --- hw/ppc/spapr_caps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index e69d308560..1cd73b617f 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())) {