From nobody Sat May 18 23:44:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1708690007; cv=none; d=zohomail.com; s=zohoarc; b=bjSPqyr1OXTaAD4qeMRo4/s58ArFN3tdcHtoKZAYARrGBuTDmQNQlT84GIiKvoWxnaHPPc+Q9nRJELuHE6vcHs+sIIIpO4aG6lPeD0XscSU4MNqYYVLQalQootvOKO/Ta398g4YMzresC5P98SMRdjm4O8YR4XEWu7QL7EB1K88= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708690007; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jp86iadmfvDn3kY5s/NcHvROQQfc/eEcQpXnyfCy0t8=; b=Q//GurC97jHzLsYqwK7AR5AY0u+ubqL/n63Z5EvW+ojKq1thAWTtrcmfzfUdjFg+QLtSO3PUMvimhhVoP4s0Ah/4Kawm7qChM2Fydd4KkzeD6+W10LtKcaZO8LWLtN7mf8FET6h+JKI7NWyFOw1J1tD2FlZeXSLR+WtGZ9gkDd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708690007259526.2289567839869; Fri, 23 Feb 2024 04:06:47 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.684817.1064962 (Exim 4.92) (envelope-from ) id 1rdUK1-0007A9-MW; Fri, 23 Feb 2024 12:06:33 +0000 Received: by outflank-mailman (output) from mailman id 684817.1064962; Fri, 23 Feb 2024 12:06:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK1-00079y-JZ; Fri, 23 Feb 2024 12:06:33 +0000 Received: by outflank-mailman (input) for mailman id 684817; Fri, 23 Feb 2024 12:06:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK0-0006xc-B7 for xen-devel@lists.xenproject.org; Fri, 23 Feb 2024 12:06:32 +0000 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [2a00:1450:4864:20::12e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fae8aaf4-d243-11ee-8a57-1f161083a0e0; Fri, 23 Feb 2024 13:06:31 +0100 (CET) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-51197ca63f5so1247513e87.1 for ; Fri, 23 Feb 2024 04:06:30 -0800 (PST) Received: from localhost ([213.195.118.74]) by smtp.gmail.com with ESMTPSA id kf3-20020a056214524300b0068fe3170b0esm88772qvb.11.2024.02.23.04.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:06:29 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fae8aaf4-d243-11ee-8a57-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1708689990; x=1709294790; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jp86iadmfvDn3kY5s/NcHvROQQfc/eEcQpXnyfCy0t8=; b=KJhAtRRhazOY55NyMGHBOdbs6ygrXx1bV746XYR78n0cdBDHgF07du3mwcOZwQUBuq 9KvFaOEe0Q8UDpIzflWzBScbmdrr0cOd3A7EVsrzIalnfzF5rUy/SaOdISVy+j4I+NVP gSaLTTUVF7M8Xj34OAPZMilwzOZIKCLEyoJU0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708689990; x=1709294790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jp86iadmfvDn3kY5s/NcHvROQQfc/eEcQpXnyfCy0t8=; b=lgTvdhFV0PFsjXyhIXTy2hKZTmtGZ03/VUXVLFa7sHiCuLXWQ5RdDvzxSVcndrWiGF FJ5FPcID8sq2pmYXO7eoCjy5p4r83cXdKhqJSyd/wiySGMvgq5/PAfO7GdHPdlgL1BG4 xA6vb+htrVyJE/t8LmvMqsPFfkasjxhaw0TZzazQyY4wE2Rb5ufqIHU5oarhUgHsELMq zyZNaLod5lIy1hSv0xs9NSH18aHpCHivHV+hTnnrpXiYEt4V+JXFoppPSGJ6zrcHmRXW PqH63gFbawCg/rYHZq1Q6OJwDR/EKizTqh0HE2vEoAiicjA8galM/w2WB5AYwCeGHLJf jNTg== X-Gm-Message-State: AOJu0YxcuXItC0qoOPvsJMyTbdjVxaqc2xLFvKfF2s6ZObhyqAdxgc97 iQNaqYw3NDzvZtY/q2eRrSSmX7wDL4jKFoA/6ZrNB4/ZNsob0VC+d4hvCITp4N6nw5KmAWKLs3y C X-Google-Smtp-Source: AGHT+IGsFXYkQjVxuWz/a4tHq/rp5C8ES+MZ65o6SqjJB1Uhw3VOCrsFHqjMlvc4Rg8ZC/gh6YiWPw== X-Received: by 2002:a05:6512:3194:b0:512:b90f:fc4e with SMTP id i20-20020a056512319400b00512b90ffc4emr1603543lfe.46.1708689990023; Fri, 23 Feb 2024 04:06:30 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2 1/3] xen/cmdline: fix printf format specifier in no_config_param() Date: Fri, 23 Feb 2024 13:06:14 +0100 Message-ID: <20240223120616.73503-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240223120616.73503-1-roger.pau@citrix.com> References: <20240223120616.73503-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1708690009438100001 '*' sets the width field, which is the minimum number of characters to outp= ut, but what we want in no_config_param() is the precision instead, which is '.= *' as it imposes a maximum limit on the output. Fixes: 68d757df8dd2 ('x86/pv: Options to disable and/or compile out 32bit P= V support') Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- Changes since v1: - New in this version. --- xen/include/xen/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/xen/param.h b/xen/include/xen/param.h index 9170455cde5c..6442a92aff8e 100644 --- a/xen/include/xen/param.h +++ b/xen/include/xen/param.h @@ -191,7 +191,7 @@ static inline void no_config_param(const char *cfg, con= st char *param, { int len =3D e ? ({ ASSERT(e >=3D s); e - s; }) : strlen(s); =20 - printk(XENLOG_INFO "CONFIG_%s disabled - ignoring '%s=3D%*s' setting\n= ", + printk(XENLOG_INFO "CONFIG_%s disabled - ignoring '%s=3D%.*s' setting\= n", cfg, param, len, s); } =20 --=20 2.43.0 From nobody Sat May 18 23:44:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1708690013; cv=none; d=zohomail.com; s=zohoarc; b=MouE0E7QOI2yZwMQDhfQoigq+iXA6g94A5SD3BTFlL26xVkp02u+Qg8S144wfhQfsCP5+EIT5rXXWEAqGXyZphqRTpFwqi79xYcBIPzdWNqY3/bAej9yUQtzb+jmZNxwxNvredpLA2l0fKSSdpDsgv7v/aHqEImgvh1rT/cfnyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708690013; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/ja3agDhYaU4Xo2ppsREM/G2NT1u2hAe6akh+/GuxDM=; b=O8/mF8z+T6a3wuFrqd1dpcKvocS9Cvxpn1IXI+I3Ig06Lx+bwFYwJLOZIUV4rYTWa8Wo8pn4HtrlmNTXHgj60LUCTCdVj+AmbHW1jAC01WKag2/dmMt91cqZbo7QPuydH+ZHUjUQJX0VrkMfQN1PT+M1NtDjE9tfdPK6rL6/RrE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708690013661550.760811800254; Fri, 23 Feb 2024 04:06:53 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.684818.1064972 (Exim 4.92) (envelope-from ) id 1rdUK4-0007Rz-Vw; Fri, 23 Feb 2024 12:06:36 +0000 Received: by outflank-mailman (output) from mailman id 684818.1064972; Fri, 23 Feb 2024 12:06:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK4-0007Rs-Qt; Fri, 23 Feb 2024 12:06:36 +0000 Received: by outflank-mailman (input) for mailman id 684818; Fri, 23 Feb 2024 12:06:35 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK3-0006di-36 for xen-devel@lists.xenproject.org; Fri, 23 Feb 2024 12:06:35 +0000 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [2a00:1450:4864:20::22c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fc67deed-d243-11ee-98f5-efadbce2ee36; Fri, 23 Feb 2024 13:06:33 +0100 (CET) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d2505352e6so7990361fa.3 for ; Fri, 23 Feb 2024 04:06:33 -0800 (PST) Received: from localhost ([213.195.118.74]) by smtp.gmail.com with ESMTPSA id d4-20020a056214184400b0068f97928376sm4150972qvy.17.2024.02.23.04.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:06:31 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fc67deed-d243-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1708689992; x=1709294792; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ja3agDhYaU4Xo2ppsREM/G2NT1u2hAe6akh+/GuxDM=; b=Dx95aEgYlAbBARDUcKB6d7uEqiRX2L8I2wOMelk01Ajl/Y/LJKoy6vcPZ6nqI++VDm B0YmeGJPTiBfvTa/ig71JzN0vixWxgbt5ylY5bK/veZ85S8h+AfgK8RFuPwj6h2Hars/ 2v684NRfXATlbIsNk36tz0bWFitnKnc11fT1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708689992; x=1709294792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ja3agDhYaU4Xo2ppsREM/G2NT1u2hAe6akh+/GuxDM=; b=tmD8EYunH32SQuQOnr+DYy5Bv9NDB/2VDmmCCR3W6myXCBbrOL42VzV8sF/vBITBNm CDPyl8UQq/VwUMrhht7xRDHqWgam5BDpOelYFv5wVUmpCRYQlRWEtY+gf9cVrnJu9lWL YkzVZBDKVs9Mn2+/pKiXL9ao9U0IBI41wpV5fTx94UAbcHkXOCRR2ymiu9gWL5CTCpPl 0JuTuIdWnTcWubDOdJWzB/Bbm6OGrB+mnOfyVC6D/+QJzvK4DsF6YcZS4K+KWUUupG1R 6SJGUwKTcwtdHgfrdXKKiErz3A68mHFxh35SFZpiwA7XPEQZQPiQ8yz/WxibptTgbADu UbdQ== X-Gm-Message-State: AOJu0YyxM6poQZ0slfM5QpXnZH/nX8S5pKeWyBJA1o97aP504BqMOdTv BSHwpcjsW7U4z3LuByAvPoXFcR0BZda064q2y3Q+YHqmd/vOONk+eB8s+MCF+/5Ffp4gGPiFbjX Q X-Google-Smtp-Source: AGHT+IF0k4Kr9lbT9FetBX+abq3S57WnQWAFi/UWuRO0TO+qnTkBGj9QAvYwkgJaW9/nk/eZloIAOQ== X-Received: by 2002:ac2:4ece:0:b0:512:e051:ac2c with SMTP id p14-20020ac24ece000000b00512e051ac2cmr1167099lfr.3.1708689992373; Fri, 23 Feb 2024 04:06:32 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 2/3] x86/spec: fix BRANCH_HARDEN option to only be set when build-enabled Date: Fri, 23 Feb 2024 13:06:15 +0100 Message-ID: <20240223120616.73503-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240223120616.73503-1-roger.pau@citrix.com> References: <20240223120616.73503-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1708690015473100002 The current logic to handle the BRANCH_HARDEN option will report it as enab= led even when build-time disabled. Fix this by only allowing the option to be s= et when support for it is built into Xen. Fixes: 2d6f36daa086 ('x86/nospec: Introduce CONFIG_SPECULATIVE_HARDEN_BRANC= H') Signed-off-by: Roger Pau Monn=C3=A9 --- Changes since v1: - Use no_config_param(). --- xen/arch/x86/spec_ctrl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index 421fe3f640df..4ce8a7a0b8ef 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -50,7 +50,8 @@ static int8_t __initdata opt_psfd =3D -1; int8_t __ro_after_init opt_ibpb_ctxt_switch =3D -1; int8_t __read_mostly opt_eager_fpu =3D -1; int8_t __read_mostly opt_l1d_flush =3D -1; -static bool __initdata opt_branch_harden =3D true; +static bool __initdata opt_branch_harden =3D + IS_ENABLED(CONFIG_SPECULATIVE_HARDEN_BRANCH); =20 bool __initdata bsp_delay_spec_ctrl; uint8_t __read_mostly default_xen_spec_ctrl; @@ -268,7 +269,14 @@ static int __init cf_check parse_spec_ctrl(const char = *s) else if ( (val =3D parse_boolean("l1d-flush", s, ss)) >=3D 0 ) opt_l1d_flush =3D val; else if ( (val =3D parse_boolean("branch-harden", s, ss)) >=3D 0 ) + { +#ifdef CONFIG_SPECULATIVE_HARDEN_BRANCH opt_branch_harden =3D val; +#else + no_config_param("SPECULATIVE_HARDEN_BRANCH", "spec-ctrl", s, s= s); + rc =3D -EINVAL; +#endif + } else if ( (val =3D parse_boolean("srb-lock", s, ss)) >=3D 0 ) opt_srb_lock =3D val; else if ( (val =3D parse_boolean("unpriv-mmio", s, ss)) >=3D 0 ) --=20 2.43.0 From nobody Sat May 18 23:44:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1708690014; cv=none; d=zohomail.com; s=zohoarc; b=f2SEx5vl3XZd8QqINY0KmlAoqxSdxuWZ6yalngnqNX/1hKxUwUcNbEEMcHP5H58AgxUgEd9+8G+Ed2FBiF5Sz0G9CgfoFBDFao4J1apuHy6PWJIXnj5sgE+RnGjUlwiwZW09bjJQOGGXKJPBw5kCAaAmhJTDq9NcI/uUIiA6ntI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708690014; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5cdfP1drv1LQ9YGslYJKltpSCLlPkSQYqQfve8zYol4=; b=NfJCLK36HCYoJkER+oQFs+QIhr1q/x0rJxFZbM1mPGOYL9hsc6IbPQ3C3lxj4kKcHUvDT1oRdNcHnET6qg8HnP0Ol8M4cW6j0ExeD6lgIeR5EYrs4HNE0XdfFBgy2APvgMLM4+JXTn0sGMDB3yNJoU9BAh+7KPqXUepEQDT8cIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1708690014451723.9240348004342; Fri, 23 Feb 2024 04:06:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.684819.1064982 (Exim 4.92) (envelope-from ) id 1rdUK7-0007jV-64; Fri, 23 Feb 2024 12:06:39 +0000 Received: by outflank-mailman (output) from mailman id 684819.1064982; Fri, 23 Feb 2024 12:06:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK7-0007jJ-3G; Fri, 23 Feb 2024 12:06:39 +0000 Received: by outflank-mailman (input) for mailman id 684819; Fri, 23 Feb 2024 12:06:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rdUK5-0006di-Pc for xen-devel@lists.xenproject.org; Fri, 23 Feb 2024 12:06:37 +0000 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [2a00:1450:4864:20::12a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fdef2b12-d243-11ee-98f5-efadbce2ee36; Fri, 23 Feb 2024 13:06:36 +0100 (CET) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-512bde3d197so210620e87.0 for ; Fri, 23 Feb 2024 04:06:36 -0800 (PST) Received: from localhost ([213.195.118.74]) by smtp.gmail.com with ESMTPSA id da35-20020a05620a362300b007854018044bsm6336939qkb.134.2024.02.23.04.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:06:34 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fdef2b12-d243-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1708689995; x=1709294795; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5cdfP1drv1LQ9YGslYJKltpSCLlPkSQYqQfve8zYol4=; b=WzJmNMYr1BCm1TZv+pfQ6eJYyox7xB7bTNJP7rUZskBurArWF4jllYZoEZWUvCIdpN RdhvrTJqNQQQl7wUGdFqbFwI9XgEFLJCqIX7I3B/HgL/2rgv0W32zUwX6kVOkoeOenum RL82WESEaMu/47eUo1R5KUOPzINgJ/v/xeLbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708689995; x=1709294795; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5cdfP1drv1LQ9YGslYJKltpSCLlPkSQYqQfve8zYol4=; b=e8+8SNnST+zyTmWp4D2bttlPCkudrecNMD2zXbzYtJwHgehVvVMPDfsnatkNQEWv/r oq+B14tQr9DnZYv6YKWXHo0UdDboVD1Qtj44GwctKe8w/7KbQzlbXaFS+YvIaGjzrnx1 ByCRwlNvIV6C9cuoKCUi2ETbzg8wx6byuQE96DaUQ36RPg68CifXrhggFLaaCa0KCOv/ Efo7rb4EqNb5xx2H/dRQYwR6us3TWl9fYL0Uqz3+RiLSnTfpqZS2VexSyeXek7tbx7EP wOVfUqu36hGZzsX/WQN1N9rfvnKK9QKsotTQCwslwu03NaaDhYoBQdRpFZlh/DG1cAmd BIPw== X-Gm-Message-State: AOJu0YxJTH1aBuuAeamw18EwEVAic0DkHeT85nPJUpncYP1UhZ/u8Rye fCLWPwegedebUlNfquXRGTC+IyFyvZFXPkq3naV4As01yl+fQaTQ9vzOcjktR3Mb/cuCdOjKsFL Y X-Google-Smtp-Source: AGHT+IHpeNl7z21jCtIKBCr1pJW/x8CWDv/TpSnAFd34Glij7WpFsufIBx3xHtkP91uwcHGLYJlfrw== X-Received: by 2002:a19:5f08:0:b0:512:d689:51cb with SMTP id t8-20020a195f08000000b00512d68951cbmr1104193lfb.26.1708689994947; Fri, 23 Feb 2024 04:06:34 -0800 (PST) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu Subject: [PATCH v2 3/3] x86/spec: fix INDIRECT_THUNK option to only be set when build-enabled Date: Fri, 23 Feb 2024 13:06:16 +0100 Message-ID: <20240223120616.73503-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240223120616.73503-1-roger.pau@citrix.com> References: <20240223120616.73503-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1708690015471100001 Attempt to provide a more helpful error message when the user attempts to s= et spec-ctrl=3Dbti-thunk option but the support is build-time disabled. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 --- Changes since v1: - New in this version. --- xen/arch/x86/spec_ctrl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index 4ce8a7a0b8ef..f3432f1a6c80 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -239,6 +239,7 @@ static int __init cf_check parse_spec_ctrl(const char *= s) /* Xen's speculative sidechannel mitigation settings. */ else if ( !strncmp(s, "bti-thunk=3D", 10) ) { +#ifdef CONFIG_INDIRECT_THUNK s +=3D 10; =20 if ( !cmdline_strcmp(s, "retpoline") ) @@ -249,6 +250,10 @@ static int __init cf_check parse_spec_ctrl(const char = *s) opt_thunk =3D THUNK_JMP; else rc =3D -EINVAL; +#else + no_config_param("INDIRECT_THUNK", "spec-ctrl", s, ss); + rc =3D -EINVAL; +#endif } =20 /* Bits in MSR_SPEC_CTRL. */ --=20 2.43.0