From nobody Thu Dec 18 05:03:03 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F7E3C4167B for ; Wed, 29 Nov 2023 11:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233042AbjK2LWx (ORCPT ); Wed, 29 Nov 2023 06:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231797AbjK2LW0 (ORCPT ); Wed, 29 Nov 2023 06:22:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAE3810EA; Wed, 29 Nov 2023 03:22:32 -0800 (PST) Date: Wed, 29 Nov 2023 11:22:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701256951; 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=HP6IetWerb4+s0lyyeErZdEKVor8JXULEZZsowb3yMw=; b=ia72P5Py7AFe2crsrm8OGsAhFhHwuQJ6zy/YYqcqHHTZrnB2Aox5fE2Iq7Zyu9RIpA7F/8 YZKwX2RC1rpa1hr4rScmNo/Qe8VLFrFpMg0MwstL7UMxsE7R5rz7+0NDxRsFqWRyuT7dCT RQnGRlspUbFXrZ1OvQQi0kn6sxz/Kg2t04M65mMMBJgxZuNp96joRPC6rootf1rWf9Ah2b Kl8Re+76cUcVQzHelLk4zBKT9yWSFpCva/8qttRfoBFvKn58NNqoqbgdbW6U366A+npD+L W/o9HzFZc7RgNuGtXuq21HCiOzkHMeT90+pZrjMRYyQ9wi0l2BgEUJfpAVC07w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701256951; 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=HP6IetWerb4+s0lyyeErZdEKVor8JXULEZZsowb3yMw=; b=KtYI+ssIeavASL4MpznGdGJsPw+d3YP548Rnl9znnXOYWTV/FMOFHwWrx3y/NrYdKxxzMc NxubNC3M/jlNybAw== From: "tip-bot2 for Borislav Petkov (AMD)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/CPU/AMD: Call the spectral chicken in the Zen2 init function Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231120104152.13740-6-bp@alien8.de> References: <20231120104152.13740-6-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170125695080.398.11018191952633732992.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cpu branch of tip: Commit-ID: cfbf4f992bfce1fa9f2f347a79cbbea0368e7971 Gitweb: https://git.kernel.org/tip/cfbf4f992bfce1fa9f2f347a79cbbea03= 68e7971 Author: Borislav Petkov (AMD) AuthorDate: Wed, 01 Nov 2023 11:20:01 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 29 Nov 2023 12:12:20 +01:00 x86/CPU/AMD: Call the spectral chicken in the Zen2 init function No functional change. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: http://lore.kernel.org/r/20231120104152.13740-6-bp@alien8.de --- arch/x86/kernel/cpu/amd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index ebe6be8..82747b6 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1007,10 +1007,8 @@ void init_spectral_chicken(struct cpuinfo_x86 *c) * * This suppresses speculation from the middle of a basic block, i.e. it * suppresses non-branch predictions. - * - * We use STIBP as a heuristic to filter out Zen2 from the rest of F17H */ - if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has(c, X86_FEATURE_AMD_STI= BP)) { + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { if (!rdmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, &value)) { value |=3D MSR_ZEN2_SPECTRAL_CHICKEN_BIT; wrmsrl_safe(MSR_ZEN2_SPECTRAL_CHICKEN, value); @@ -1081,6 +1079,7 @@ static void zenbleed_check(struct cpuinfo_x86 *c) =20 static void init_amd_zen2(struct cpuinfo_x86 *c) { + init_spectral_chicken(c); fix_erratum_1386(c); } =20 @@ -1136,7 +1135,7 @@ static void init_amd(struct cpuinfo_x86 *c) case 0x12: init_amd_ln(c); break; case 0x15: init_amd_bd(c); break; case 0x16: init_amd_jg(c); break; - case 0x17: init_spectral_chicken(c); + case 0x17: fallthrough; case 0x19: init_amd_zn(c); break; }