Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp178414lqj; Wed, 10 Apr 2024 07:31:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWD+bxPXYqXtTtY3XNumkcqJl0B2lCag6k0SYfcPhcZyV4DF4RRmuKKtiQ9+FKyMA76mbqMo+zBn80un4cIF8ldd7DLPcmHzQNzTyfS9w== X-Google-Smtp-Source: AGHT+IFegRW7ln28YEgOq9r/r+eWtkf56UgLkaepL9RzCvzxV4S48+XE8PLJtP6031HdYD5DX+zY X-Received: by 2002:a05:622a:1108:b0:432:f3be:e16b with SMTP id e8-20020a05622a110800b00432f3bee16bmr2977062qty.57.1712759494473; Wed, 10 Apr 2024 07:31:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712759494; cv=pass; d=google.com; s=arc-20160816; b=sidZ2Pnz0bVw5VOP4FsM3pgaZynwiJM1meD+Dj3ddfzV6L4ZXVSjojpHsQ2Qt+dqa0 /wQu8PXPQIU+iqFC9Q99L7G60gj0/3YWL229Bg/XzgI+D7WMUQ5mj+2qRl5I9mUx6BUx H3t+ZdhZTRs7nLPz1tkmD5uV/ZK9kBcgMh17LqNQVulC3U16LWNH8bsHiJOZe5R0I0VZ HRuM0l+MT57qetvePuKfiMpCmvJcKywgaBPwTWRmfnOY+qz063Wu9DzsibaqqP7CXdhR vBUvcZkczWFMTfBNYpIO18pmkvqw65m0SqVTNLYhNS58UOIm00MGmFmgLxSSPtteKmB2 l4WQ== ARC-Message-Signature: i=2; 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=mYX3zOm/lIqRQk8fDRkW2GWS1VHCXhoLB5o/wti6kvQ=; fh=PE2AfA+e3mCa+iWAt+BhD4BETW5pGl05DxD1LfFwCec=; b=v6GzGzZe7zoZmR6PSJwRGkRWs+OsZpP2EPChhUgLC/Pcbtz5jxRphIMQ1FUakz9gks omLtesxFlG7uNmnkpXIW8KyDDqBRXNZrzP+zRJPuuSPp1xCU+vUaVl8ZYcFz3UvF1cAL FjYt2BdK/+hod19mUFK/JkFbVrpMoLAe2jcVFKKGvv6ppWSK/QrIt0AELBYBo+FkpdFX IZLMLjR5yK0QoQiubFtDo5RV1vb36dAjYtPxEz5j/f/VIdILnx3n1SlSQxr7+JFBtJ5k LTmFIjD7e2K3y8cEqTX5gUYZmNfJ3aarGZX5jSrXXAzBV56zTjiJrwhyKNvMrtyQ1k9O GABg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nPNG93Qb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-138751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y8-20020ac85f48000000b004346197bd33si12011184qta.500.2024.04.10.07.31.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 07:31:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nPNG93Qb; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-138751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138751-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 279501C20443 for ; Wed, 10 Apr 2024 14:31:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46EDE16D4EB; Wed, 10 Apr 2024 14:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nPNG93Qb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hemBqPvG" 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 04A44158D70; Wed, 10 Apr 2024 14:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712759483; cv=none; b=R85gJ9/ipkBvcXj+O0khp9K6VKygIJNWXikJn95elwCXkZCJupwoomz47w5RUAym6ai5xTLddgcf1P7WDA53tTJ7+JQ41iCqcWFt5/5+PLmNZTMB4prLb2A61a1t9/N4vyaviE8GqPIdlPCz9thuT9Naan9r8rK4Y0Ub3GFMNnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712759483; c=relaxed/simple; bh=DnlVN7F0de0eJH9mE1+52DEgW2DBXct6it/rcLENdo8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=b9Gp6eKbCxY552bwsPCqL2OzN1lQ3BVbXaJUU7irZbh9Gaj23dNho5EGbKeCfrdGCA0LusoM2UjeMAwNqekwF+tsrkuxJtmMQGoUamhF/0OuInO9+MlUWJ8WlNHwdgR4zD+/jcidaXKzBXbkXD0bIxLjns15kdZmwqHIHtB/mCU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nPNG93Qb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hemBqPvG; arc=none smtp.client-ip=193.142.43.55 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 Apr 2024 14:31:18 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712759480; 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=mYX3zOm/lIqRQk8fDRkW2GWS1VHCXhoLB5o/wti6kvQ=; b=nPNG93QbP0fPVVpMZaLoHazEJtZbvlMsiQYpY6iG3gWMaW3f6fl1LFnG2wCuae7T2M5iPn Q601OjlPIU2V8sMTt/zz8PyvZ0km8CqO929XRvzB+TjrzK5+sbQkndEADyhU3UQ1clqGcD zrkaa33tqIO3qMUAY60RiO59PNaOiCmuYf0SlGJ2znxvnPUjsBgMcQxB29CtkTd9cYhxEb iLcQITw5BttSVW8JRk3qu6VcJAizo9uPH0/uu5nCm8/3DslJEBhHsr5q8tpZAB3ZwOHPAo W7vKMO9fZ1OJokuP0uNdB/05f6SH3+T5d3SopSqHWewr/Wlwcz905DBa6/h68w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712759480; 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=mYX3zOm/lIqRQk8fDRkW2GWS1VHCXhoLB5o/wti6kvQ=; b=hemBqPvGmAbfVuElinRXHyAgQK40Y6ytWEVfaoZ94knsNwMolk1OgxDB3hNzbXix3ER+p7 ThxwcTD5qPTCBKDA== From: "tip-bot2 for Sean Christopherson" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/cpu: Disable BHI mitigation by default when SPECULATION_MITIGATIONS=n Cc: Sean Christopherson , Ingo Molnar , Daniel Sneddon , stable@vger.kernel.org, Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240409175108.1512861-3-seanjc@google.com> References: <20240409175108.1512861-3-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171275947899.10875.3224050314165203955.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/urgent branch of tip: Commit-ID: e8f2ec1cc10e86adfc2089fb93a1158e69989bbd Gitweb: https://git.kernel.org/tip/e8f2ec1cc10e86adfc2089fb93a1158e69989bbd Author: Sean Christopherson AuthorDate: Tue, 09 Apr 2024 10:51:06 -07:00 Committer: Ingo Molnar CommitterDate: Wed, 10 Apr 2024 16:22:56 +02:00 x86/cpu: Disable BHI mitigation by default when SPECULATION_MITIGATIONS=n Rework the initialization of bhi_mitigation to use positive CONFIG tests for the ON/AUTO cases so that lack of *any* CONFIG_SPECTRE_BHI_* #define, i.e. when the kernel is built with CONFIG_SPECULATION_MITIGATIONS=n, results in the mitigation being OFF by default, not AUTO. Per the help text for SPECULATION_MITIGATIONS, the intent is that 'N' disables all mitigations. Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob") Signed-off-by: Sean Christopherson Signed-off-by: Ingo Molnar Reviewed-by: Daniel Sneddon Cc: stable@vger.kernel.org Cc: Linus Torvalds Link: https://lore.kernel.org/r/20240409175108.1512861-3-seanjc@google.com --- arch/x86/kernel/cpu/bugs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 27f5004..7e4a706 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -1630,9 +1630,9 @@ enum bhi_mitigations { }; static enum bhi_mitigations bhi_mitigation __ro_after_init = - IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : - IS_ENABLED(CONFIG_SPECTRE_BHI_OFF) ? BHI_MITIGATION_OFF : - BHI_MITIGATION_AUTO; + IS_ENABLED(CONFIG_SPECTRE_BHI_ON) ? BHI_MITIGATION_ON : + IS_ENABLED(CONFIG_SPECTRE_BHI_AUTO) ? BHI_MITIGATION_AUTO : + BHI_MITIGATION_OFF; static int __init spectre_bhi_parse_cmdline(char *str) {