From patchwork Fri Feb 23 12:06:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13568970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0A20C5478C for ; Fri, 23 Feb 2024 12:06:45 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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 Attempt to provide a more helpful error message when the user attempts to set spec-ctrl=bti-thunk option but the support is build-time disabled. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monné --- 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=", 10) ) { +#ifdef CONFIG_INDIRECT_THUNK s += 10; if ( !cmdline_strcmp(s, "retpoline") ) @@ -249,6 +250,10 @@ static int __init cf_check parse_spec_ctrl(const char *s) opt_thunk = THUNK_JMP; else rc = -EINVAL; +#else + no_config_param("INDIRECT_THUNK", "spec-ctrl", s, ss); + rc = -EINVAL; +#endif } /* Bits in MSR_SPEC_CTRL. */