From nobody Fri Oct 24 20:19:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518776114466364.5668132691238; Fri, 16 Feb 2018 02:15:14 -0800 (PST) Received: from localhost ([::1]:59125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emd2v-0000B0-K3 for importer@patchew.org; Fri, 16 Feb 2018 05:15:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emcuW-0001cK-Ex for qemu-devel@nongnu.org; Fri, 16 Feb 2018 05:06:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emcuT-0005F8-OH for qemu-devel@nongnu.org; Fri, 16 Feb 2018 05:06:32 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:36661) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emcuT-00059z-9N; Fri, 16 Feb 2018 05:06:29 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3zjTLl4s6Qz9t7H; Fri, 16 Feb 2018 21:06:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1518775583; bh=MSEyjh/HePPxYhzgc0iPvAPmhY+l+W8UbUhBTr6NpuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UJJUMM9LtceG4i0O4XrPzaoqkJwk+vijwxuO1191rkUouXzEDZ3MDw/TYuuDM2HKR Atr5crzM8S4ZZ0tdJXovhK3jiL8p28rREOnyMmIgPQTMOBBRZYvaFfGB196Kn5W3c4 8kreIziEAIu7JFmV8TLTFXk6Zle52iVVREpdp9TM= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 16 Feb 2018 21:06:16 +1100 Message-Id: <20180216100617.25265-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180216100617.25265-1-david@gibson.dropbear.id.au> References: <20180216100617.25265-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 13/14] 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: lvivier@redhat.com, surajjs@au1.ibm.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, Suraj Jitindar Singh , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Suraj Jitindar Singh 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 Signed-off-by: David Gibson --- 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(sPAPRMachineSta= te *spapr, uint8_t val, static void cap_safe_indirect_branch_apply(sPAPRMachineState *spapr, uint8_t val, Error **errp) { - if (tcg_enabled() && val) { + if (val =3D=3D SPAPR_CAP_WORKAROUND) { /* Can only be Broken or Fixed = */ + error_setg(errp, "Requested safe indirect branch capability level = \"workaround\" not valid, try cap-ibs=3Dfixed"); + } 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] =3D= { }, [SPAPR_CAP_IBS] =3D { .name =3D "ibs", - .description =3D "Indirect Branch Serialisation" VALUE_DESC_TRISTA= TE, + .description =3D "Indirect Branch Serialisation (broken, fixed)", .index =3D SPAPR_CAP_IBS, .get =3D spapr_cap_get_tristate, .set =3D spapr_cap_set_tristate, --=20 2.14.3