Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp541245rdf; Tue, 21 Nov 2023 09:13:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZM+3aaP7daXB2o2qZPnr1FiMu1Vwu/oWJdktlGrc1eXScyMwpTqp2Lf56tAUgzNXl6+oP X-Received: by 2002:a05:6a20:2585:b0:18a:e003:21b6 with SMTP id k5-20020a056a20258500b0018ae00321b6mr2778738pzd.61.1700586827096; Tue, 21 Nov 2023 09:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700586827; cv=none; d=google.com; s=arc-20160816; b=xSo1QXJOceeXfzeLPCZGxzoMh+DJ++W176gAd9Rc439gR3DAn7LhNbgQi80GZuHX/C 04Zlb4yOExFf6c3AT65hhLIKw/AcTiMeQ6bIjbqKk0/TFbYfvr/J4T1VUxeMkcyWanXR G3ilgQvazeZuifXlgqHN9dQDlTMluHKcKbHFqZQtRyGsyaWK8Q7RSe6QRtqeswFQKl6U UFGcflzzlf6hBQUBKtIRyXZThSS2oFq4jzbUMEbiV7NVVHtkqQCfoSFEmZqgxx4iILCC +9tKaWYuJUs7Gw6oYWuUtXW1R/80s2moXKYpD3JJw8yHAex6IJ/dZCKpp2OUd6nG2xxL XUzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jxW+vd4Gib/Bhd3cLzzpB/nRoSJ1TOI/3RxosIZWZPM=; fh=frWHIxvg0FpJXq2MlP/Sjuu1HBKUBSteApddVjeD8Vo=; b=vaZB8ma/7TdMNGMsL069icvCe1CRGYrt8htIf+8g0XmO6YUn5d6e8+a1RdSuS7mL67 gj9FLoOlyjUuIyc+Pt6LrhEcqP5lNU1teB41Dc3FTsxeHSuMHgrboeKu3Ft4pu2KNkNk 6VMmoXXH2kmBLbQ5p97GLyK48GD4KXl+Gv1z7hGmaCIkYy0KGMYR88q6LbThuUm/FFmF 2QcmQ4z6+1W50IdSkDSUwTgqOIEIgpLTuWUYPE/0rG7nP71IP65EdHKUoaWapppFio6f O4TSmBdTjmsiqP1/KLBwvtn3xLtMuFL+PUD7ph5sIx4rRwCgKePmxM7IPzuGkrFUr7ds AHhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id x22-20020aa78f16000000b0068fee0e95c5si10207344pfr.89.2023.11.21.09.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 09:13:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2247E80C6EBD; Tue, 21 Nov 2023 09:13:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234176AbjKURMc (ORCPT + 99 others); Tue, 21 Nov 2023 12:12:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234150AbjKURM1 (ORCPT ); Tue, 21 Nov 2023 12:12:27 -0500 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99ACDD4F for ; Tue, 21 Nov 2023 09:12:23 -0800 (PST) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a00a9c6f1e9so245422966b.3 for ; Tue, 21 Nov 2023 09:12:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700586742; x=1701191542; 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=jxW+vd4Gib/Bhd3cLzzpB/nRoSJ1TOI/3RxosIZWZPM=; b=dvTd33Ohgugo7MocB0PjfreHakXGAWdcbk4Opk4r1+0PFtsW1EkpxFDvfuRjpmH/pc NS+te2R/jGwM14P2VE6RB51RdQ+hfdVwpceEAFeRbzYANnbR7oI/LcfHJZuRsTt2z/S1 dHuBSAMjyH7iGZisjIIZWCBC7TwWrc7G37qyNVNwrYP4DxBsVZOVOqmI5IxZTDwmO0RK F/tYwB8b+4MqzCbQb0vLbDeLnA6B08sG+/GOHMe1TYfv4Xs79Sx4dj2nep5a2VWjSaEe +/VYQcqQDqLmDQgFEcxGbMy7op7JV5Ei/bjyg/a5aO33wshFvdNzAtWs6iHx27i5MNFR iMtQ== X-Gm-Message-State: AOJu0YwzsdmROf/b0XAabUT2WEVPSDoOtmKHKoWgIM/z7QmXRCaT10si L5LCSJ2dxeM3qjTLTSJDcgM= X-Received: by 2002:a17:906:ecef:b0:a03:9b32:d8a2 with SMTP id qt15-20020a170906ecef00b00a039b32d8a2mr337533ejb.60.1700586742023; Tue, 21 Nov 2023 09:12:22 -0800 (PST) Received: from localhost (fwdproxy-cln-000.fbsv.net. [2a03:2880:31ff::face:b00c]) by smtp.gmail.com with ESMTPSA id i3-20020a1709061cc300b009a1a653770bsm5424753ejh.87.2023.11.21.09.12.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 09:12:21 -0800 (PST) From: Breno Leitao To: jpoimboe@kernel.org, mingo@redhat.com, tglx@linutronix.de, bp@alien8.de, Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Pawan Gupta Cc: leit@meta.com, linux-kernel@vger.kernel.org Subject: [PATCH v6 08/13] x86/bugs: Rename CPU_IBRS_ENTRY to MITIGATION_IBRS_ENTRY Date: Tue, 21 Nov 2023 08:07:35 -0800 Message-Id: <20231121160740.1249350-9-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231121160740.1249350-1-leitao@debian.org> References: <20231121160740.1249350-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 09:13:23 -0800 (PST) CPU mitigations config entries are inconsistent, and names are hard to related. There are concrete benefits for both users and developers of having all the mitigation config options living in the same config namespace. The mitigation options should have consistency and start with MITIGATION. Rename the Kconfig entry from CPU_IBRS_ENTRY to MITIGATION_IBRS_ENTRY. Suggested-by: Josh Poimboeuf Signed-off-by: Breno Leitao --- arch/x86/Kconfig | 2 +- arch/x86/entry/calling.h | 4 ++-- arch/x86/kernel/cpu/bugs.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index fa078d3655ff..392e94fded3d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2564,7 +2564,7 @@ config MITIGATION_IBPB_ENTRY help Compile the kernel with support for the retbleed=ibpb mitigation. -config CPU_IBRS_ENTRY +config MITIGATION_IBRS_ENTRY bool "Enable IBRS on kernel entry" depends on CPU_SUP_INTEL && X86_64 default y diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index ace89d5c1ddd..2afdff42c107 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h @@ -297,7 +297,7 @@ For 32-bit we have the following conventions - kernel is built with * Assumes x86_spec_ctrl_{base,current} to have SPEC_CTRL_IBRS set. */ .macro IBRS_ENTER save_reg -#ifdef CONFIG_CPU_IBRS_ENTRY +#ifdef CONFIG_MITIGATION_IBRS_ENTRY ALTERNATIVE "jmp .Lend_\@", "", X86_FEATURE_KERNEL_IBRS movl $MSR_IA32_SPEC_CTRL, %ecx @@ -326,7 +326,7 @@ For 32-bit we have the following conventions - kernel is built with * regs. Must be called after the last RET. */ .macro IBRS_EXIT save_reg -#ifdef CONFIG_CPU_IBRS_ENTRY +#ifdef CONFIG_MITIGATION_IBRS_ENTRY ALTERNATIVE "jmp .Lend_\@", "", X86_FEATURE_KERNEL_IBRS movl $MSR_IA32_SPEC_CTRL, %ecx diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 2580368c32d1..e11bacbd8f39 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1439,7 +1439,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) return SPECTRE_V2_CMD_AUTO; } - if (cmd == SPECTRE_V2_CMD_IBRS && !IS_ENABLED(CONFIG_CPU_IBRS_ENTRY)) { + if (cmd == SPECTRE_V2_CMD_IBRS && !IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY)) { pr_err("%s selected but not compiled in. Switching to AUTO select\n", mitigation_options[i].option); return SPECTRE_V2_CMD_AUTO; @@ -1565,7 +1565,7 @@ static void __init spectre_v2_select_mitigation(void) break; } - if (IS_ENABLED(CONFIG_CPU_IBRS_ENTRY) && + if (IS_ENABLED(CONFIG_MITIGATION_IBRS_ENTRY) && boot_cpu_has_bug(X86_BUG_RETBLEED) && retbleed_cmd != RETBLEED_CMD_OFF && retbleed_cmd != RETBLEED_CMD_STUFF && -- 2.34.1