From nobody Wed Dec 17 07:28:48 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 4250AC4167B for ; Wed, 29 Nov 2023 11:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbjK2LW5 (ORCPT ); Wed, 29 Nov 2023 06:22:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232454AbjK2LWb (ORCPT ); Wed, 29 Nov 2023 06:22:31 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CEE10DF; Wed, 29 Nov 2023 03:22:34 -0800 (PST) Date: Wed, 29 Nov 2023 11:22:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701256952; 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=KcsRdEhCEWuA2oxqFTOi/En70y4wwOfq3wTyKpaSxdY=; b=4VA5GbcJQ/Mcazc+zNZiIIHd4qskZMqM99NjUntuhghFVfN/NGV0nwbDPzxYKPcNCb21pD p1oYupoukW7zfHbnbRVp+9wN3qRHdfUYEXGHRMZ3cjI+ldWgZmb3pOongCkh2pUred3cqb Ig0NvBJSuajDLyHCYvWLlxyzKGcjIDO8/p9P5XwHjt8VubHl7cFZapq0fom1oodTCHHUBy 2C0SpM79dQvdziOxzt0smjyUwTZoSLk/r+zzONB/WxTACIWmcCVyvk21K3fOr9mUo7rHcI P7gwxsY6stSvai2Vo8ofPSW153z/UuefLcinNHteKUO35Vwu/5edxmJgSq+nWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701256952; 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=KcsRdEhCEWuA2oxqFTOi/En70y4wwOfq3wTyKpaSxdY=; b=2yiEqc2Gl2zGQLyLryCeRn+XPI/rYtq80s5Tr7l9eSWQm+5loY0bbta0tiuHZaES2uNAof 1P0qLIFIjykac2DA== 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: Move the Zen3 BTC_NO detection to the Zen3 init function Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231120104152.13740-4-bp@alien8.de> References: <20231120104152.13740-4-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170125695229.398.10463194066767455972.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: affc66cb96f865b3763a8e18add52e133d864f04 Gitweb: https://git.kernel.org/tip/affc66cb96f865b3763a8e18add52e133= d864f04 Author: Borislav Petkov (AMD) AuthorDate: Wed, 01 Nov 2023 11:28:31 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 29 Nov 2023 12:11:44 +01:00 x86/CPU/AMD: Move the Zen3 BTC_NO detection to the Zen3 init function No functional changes. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: http://lore.kernel.org/r/20231120104152.13740-4-bp@alien8.de --- arch/x86/kernel/cpu/amd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 0a499cb..3d74347 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -1031,14 +1031,6 @@ static void init_amd_zn(struct cpuinfo_x86 *c) /* Erratum 1076: CPB feature bit not being set in CPUID. */ if (!cpu_has(c, X86_FEATURE_CPB)) set_cpu_cap(c, X86_FEATURE_CPB); - - /* - * Zen3 (Fam19 model < 0x10) parts are not susceptible to - * Branch Type Confusion, but predate the allocation of the - * BTC_NO bit. - */ - if (c->x86 =3D=3D 0x19 && !cpu_has(c, X86_FEATURE_BTC_NO)) - set_cpu_cap(c, X86_FEATURE_BTC_NO); } } =20 @@ -1094,6 +1086,15 @@ static void init_amd_zen2(struct cpuinfo_x86 *c) =20 static void init_amd_zen3(struct cpuinfo_x86 *c) { + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { + /* + * Zen3 (Fam19 model < 0x10) parts are not susceptible to + * Branch Type Confusion, but predate the allocation of the + * BTC_NO bit. + */ + if (!cpu_has(c, X86_FEATURE_BTC_NO)) + set_cpu_cap(c, X86_FEATURE_BTC_NO); + } } =20 static void init_amd_zen4(struct cpuinfo_x86 *c)