Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp879164rdd; Wed, 10 Jan 2024 02:13:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGxQ0KTSQaorMF58RieHBa79FxWG9kv4EZ6C+qth00jhdRXW/04uSejdgp9u/ojoRY3fF2m X-Received: by 2002:a05:6808:21a9:b0:3bb:ceb4:b7a5 with SMTP id be41-20020a05680821a900b003bbceb4b7a5mr1061554oib.74.1704881600619; Wed, 10 Jan 2024 02:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704881600; cv=none; d=google.com; s=arc-20160816; b=M9QHzqkKhh1t6NsBf33/fmFEHEcDe88jRGlHTDnSnEwzR8K6ylSRSXlNa/LzLeEc88 T2OKC+qf5qQYNinz+8cQrqtm2C28+7Hk0HOLtbPw8sk8aeCnv3ruawnGfN0NfTosQmGW Om+8yYDApvfQTtO4JZf9bdqm7cit4fTskMKYtYsrprFmnTwXWdQwAFfJ+SgD8p74ih6S YjFyyshMjNiH5hWR/BHxC7K0/Q7Q19L7aBA/iyoPgw15kn9zFrql0EA6HVFgesS5jA2Y dEFf1JMZc4s1JDnZ5oJvTg0zSoiNylUefns2wuRM6RYKtYq74WSYcAgaTWnO6C5mhjFy 9ghg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=GYxbHtuid2EZTa/ckkcgbQp+CgiOVEhAFcrS49OWqlU=; fh=w9LP7x4fMDC4MQwSw7dBmiHv9ezjNVwOsQKnG8RpbJ8=; b=Ez+5JZIvC88TiUYEIIq53f8Ok4vSofle6tZfoF8fzBuDqK18BpKzOKfORr1mgRG5El iX/lfpcB+fV1ckh0bmgdNembFJDUWX2aSWG3Si8L20DIdvmE5STExJQsGFTIu0HE3iRZ E/O2tYByOFszkbiTsalEIlSnhg5km6cL9xQ18G7f4u6CO/UdTqrbQq7W/9iN3OV0S6D9 fmqu0IMqaI17yr5cvipj0/cxm7+xcpOM/b0pdhP4d87ecb23Mf0jm+GFS+SorxgTqY5w 9RRtqtluwiR7D4Dw0yL44vdksFkMYeV+pOOIaCLLraLg6F4ARDumeEaNnIHXD2dt5n5A xz1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p2uvqbW8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-21948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q9-20020a63e209000000b005be34495eedsi3334486pgh.118.2024.01.10.02.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 02:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p2uvqbW8; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-21948-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21948-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2FA87B26D7A for ; Wed, 10 Jan 2024 10:11:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC9E74176B; Wed, 10 Jan 2024 10:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="p2uvqbW8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zZQLX3qb" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2D8F405F2; Wed, 10 Jan 2024 10:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 10 Jan 2024 10:09:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1704881395; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GYxbHtuid2EZTa/ckkcgbQp+CgiOVEhAFcrS49OWqlU=; b=p2uvqbW8qCjxhzR1aTsX+QE8H4mnASP2vsz2CBAzQJMtroMf6qdxkjUkcWZKAbRtCCFjcz gwJQj+wdINnlNbHmGhD9joyfRyNJb7/5qsMnYV35wCXgQS3oXG0dhFn3K5T8tEOHO/ixVA 5Ow0vTkm2chsGflJoM0tXn/u8A+wk1T219w7L6iWBJzGBGc4nd8wdxZZ7Km2TDzYTFqMnM 6GIHazVAE98xZ6wxiLWaHEp6zwPDcBRyOnPsUIdXkSEWbsb4mpbI6EFa6XufsjR8Pcfh2Q Ah5+bgQj7yAUn34JkwiPiGKOH9zfBCHEKhEoF+7AJ1gOGEdyDpLORI4gBcN9+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1704881395; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GYxbHtuid2EZTa/ckkcgbQp+CgiOVEhAFcrS49OWqlU=; b=zZQLX3qb/6UV9N3a3SE6b+fG7wQs33eTUB/ma0vvJ8Pf4tqxznhsyMtY5TF0gBkAD2yHVP Z/jpmo6qf7EUKMCg== From: "tip-bot2 for Breno Leitao" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/bugs] x86/bugs: Rename CONFIG_CPU_IBPB_ENTRY => CONFIG_MITIGATION_IBPB_ENTRY Cc: Josh Poimboeuf , Breno Leitao , Ingo Molnar , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231121160740.1249350-3-leitao@debian.org> References: <20231121160740.1249350-3-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170488139448.398.13871271510194564443.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/bugs branch of tip: Commit-ID: e0b8fcfa3cfac171d589ad6085a00c584d571f08 Gitweb: https://git.kernel.org/tip/e0b8fcfa3cfac171d589ad6085a00c584d571f08 Author: Breno Leitao AuthorDate: Tue, 21 Nov 2023 08:07:29 -08:00 Committer: Ingo Molnar CommitterDate: Wed, 10 Jan 2024 10:52:28 +01:00 x86/bugs: Rename CONFIG_CPU_IBPB_ENTRY => CONFIG_MITIGATION_IBPB_ENTRY Step 2/10 of the namespace unification of CPU mitigations related Kconfig options. Suggested-by: Josh Poimboeuf Signed-off-by: Breno Leitao Signed-off-by: Ingo Molnar Acked-by: Josh Poimboeuf Cc: Linus Torvalds Link: https://lore.kernel.org/r/20231121160740.1249350-3-leitao@debian.org --- arch/x86/Kconfig | 2 +- arch/x86/include/asm/nospec-branch.h | 2 +- arch/x86/kernel/cpu/bugs.c | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 1dba33a..c4e04b6 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2554,7 +2554,7 @@ config CALL_THUNKS_DEBUG Only enable this when you are debugging call thunks as this creates a noticeable runtime overhead. If unsure say N. -config CPU_IBPB_ENTRY +config MITIGATION_IBPB_ENTRY bool "Enable IBPB on kernel entry" depends on CPU_SUP_AMD && X86_64 default y diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 262e655..7341fd9 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -289,7 +289,7 @@ * where we have a stack but before any RET instruction. */ .macro __UNTRAIN_RET ibpb_feature, call_depth_insns -#if defined(CONFIG_RETHUNK) || defined(CONFIG_CPU_IBPB_ENTRY) +#if defined(CONFIG_RETHUNK) || defined(CONFIG_MITIGATION_IBPB_ENTRY) VALIDATE_UNRET_END ALTERNATIVE_3 "", \ CALL_UNTRAIN_RET, X86_FEATURE_UNRET, \ diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 3c7e27b..1de4791 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -994,10 +994,10 @@ static void __init retbleed_select_mitigation(void) if (!boot_cpu_has(X86_FEATURE_IBPB)) { pr_err("WARNING: CPU does not support IBPB.\n"); goto do_cmd_auto; - } else if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY)) { + } else if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY)) { retbleed_mitigation = RETBLEED_MITIGATION_IBPB; } else { - pr_err("WARNING: kernel not compiled with CPU_IBPB_ENTRY.\n"); + pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n"); goto do_cmd_auto; } break; @@ -1023,7 +1023,8 @@ do_cmd_auto: boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) { if (IS_ENABLED(CONFIG_CPU_UNRET_ENTRY)) retbleed_mitigation = RETBLEED_MITIGATION_UNRET; - else if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY) && boot_cpu_has(X86_FEATURE_IBPB)) + else if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY) && + boot_cpu_has(X86_FEATURE_IBPB)) retbleed_mitigation = RETBLEED_MITIGATION_IBPB; } @@ -2482,13 +2483,13 @@ static void __init srso_select_mitigation(void) break; case SRSO_CMD_IBPB: - if (IS_ENABLED(CONFIG_CPU_IBPB_ENTRY)) { + if (IS_ENABLED(CONFIG_MITIGATION_IBPB_ENTRY)) { if (has_microcode) { setup_force_cpu_cap(X86_FEATURE_ENTRY_IBPB); srso_mitigation = SRSO_MITIGATION_IBPB; } } else { - pr_err("WARNING: kernel not compiled with CPU_IBPB_ENTRY.\n"); + pr_err("WARNING: kernel not compiled with MITIGATION_IBPB_ENTRY.\n"); } break;