From nobody Sun Feb 8 15:46:21 2026 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 B000C47796; Thu, 5 Sep 2024 09:47:41 +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=1725529663; cv=none; b=eAkkqCExeorieNbh1Qqy3jcd4lBUGGcZUh3hZWuSleWe1JaziGbec3KvEDm83M956FC6nLlkvdar6PZNJxpAyVu803DuyEMx5BvnBtnkJpFZdRj4SAjZJObJCyNJ0TVYjFGfiARk/OxDg/VqN+tVXJ289av2x6W1e1qkw0jE9vQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725529663; c=relaxed/simple; bh=xMzNaWyGUWpvjW9EV6HlXMME3B51Ls+X/dfJ8kjXxhM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=ZZIZcQ3DfHqcE+srft45i9kPEDfoSkvR7dLBhtUa5RgbH7a+GL9JJR8TrBmtxkI2phzNSBYmmsdMTjZ8WyCQvLJfIMJtZtN6+fnMaTj/kYawjw/dsMM2v6sAiDrs5dLJJioCidflPemYQVDh+oG9iBBQLQR7Ye8SACyUD/lhPxQ= 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=ecjbbmdf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=inonchWK; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ecjbbmdf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="inonchWK" Date: Thu, 05 Sep 2024 09:47:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1725529659; 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=HyRCT1hnfWSq9RQNa238X5cw7dy/AXs7k5VYwEFO0dQ=; b=ecjbbmdfUVhrmoGly/ygbBLj4eDovbLp6MJLh2abiwD+VnsNS9fF7iwO/bClio1HseVV75 KeemMpdt8+vjGhxxIgwgVfD4T/GeHb9xzDZEZ5Q4ApFaxvvvMmMKwzIKUMwXlTgIC1P5J8 yC8H6KnJYI3LoEn5LqI42RNCAwph3Bv+1JtMjqr0iqDm4Yjd3CKLdpddDFE+vIhr79i8uW /i3dNT56QOWnIk7BeK06XkTUbSUeeYUtGbUUM7sDiDAuf1foWuuc3Rk2nqRH3rPQpTmC4u deY5ML8aMBr3IuM3cr8S1xGUPs8LTeekC0GsM+i7bvQg0zR2j4IU2wVIHX9YRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1725529659; 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=HyRCT1hnfWSq9RQNa238X5cw7dy/AXs7k5VYwEFO0dQ=; b=inonchWKC2gIIC6R+7UAYlSgma4up7VX+bFwEKI+LBnaCSpHfS5UsLhLz0dMaeptf+BoxP 30SiGJPrwpPXuOCg== From: "tip-bot2 for David Kaplan" 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: Fix handling when SRSO mitigation is disabled Cc: David Kaplan , "Borislav Petkov (AMD)" , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240904150711.193022-1-david.kaplan@amd.com> References: <20240904150711.193022-1-david.kaplan@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <172552965872.2215.17085347492363546574.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: quoted-printable The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 1dbb6b1495d472806fef1f4c94f5b3e4c89a3c1d Gitweb: https://git.kernel.org/tip/1dbb6b1495d472806fef1f4c94f5b3e4c= 89a3c1d Author: David Kaplan AuthorDate: Wed, 04 Sep 2024 10:07:11 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Thu, 05 Sep 2024 11:20:50 +02:00 x86/bugs: Fix handling when SRSO mitigation is disabled When the SRSO mitigation is disabled, either via mitigations=3Doff or spec_rstack_overflow=3Doff, the warning about the lack of IBPB-enhancing microcode is printed anyway. This is unnecessary since the user has turned off the mitigation. [ bp: Massage, drop SBPB rationale as it doesn't matter because when mitigations are disabled x86_pred_cmd is not being used anyway. ] Signed-off-by: David Kaplan Signed-off-by: Borislav Petkov (AMD) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20240904150711.193022-1-david.kaplan@amd.com --- arch/x86/kernel/cpu/bugs.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 189840d..d191542 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2557,10 +2557,9 @@ static void __init srso_select_mitigation(void) { bool has_microcode =3D boot_cpu_has(X86_FEATURE_IBPB_BRTYPE); =20 - if (cpu_mitigations_off()) - return; - - if (!boot_cpu_has_bug(X86_BUG_SRSO)) { + if (!boot_cpu_has_bug(X86_BUG_SRSO) || + cpu_mitigations_off() || + srso_cmd =3D=3D SRSO_CMD_OFF) { if (boot_cpu_has(X86_FEATURE_SBPB)) x86_pred_cmd =3D PRED_CMD_SBPB; return; @@ -2591,11 +2590,6 @@ static void __init srso_select_mitigation(void) } =20 switch (srso_cmd) { - case SRSO_CMD_OFF: - if (boot_cpu_has(X86_FEATURE_SBPB)) - x86_pred_cmd =3D PRED_CMD_SBPB; - return; - case SRSO_CMD_MICROCODE: if (has_microcode) { srso_mitigation =3D SRSO_MITIGATION_MICROCODE; @@ -2649,6 +2643,8 @@ static void __init srso_select_mitigation(void) pr_err("WARNING: kernel not compiled with MITIGATION_SRSO.\n"); } break; + default: + break; } =20 out: