Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4502098rdh; Wed, 29 Nov 2023 03:23:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEYAWnDmu+vVA6ZmzPsHlX0JTww+hc3cKYN4I+kUxqS9SkeGY5S2HCAnXoQJNhqRFuop4l X-Received: by 2002:a05:6a20:54a6:b0:18c:9748:ac3c with SMTP id i38-20020a056a2054a600b0018c9748ac3cmr10158835pzk.36.1701256998586; Wed, 29 Nov 2023 03:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256998; cv=none; d=google.com; s=arc-20160816; b=XIpocPbmSCO7AUpprE/yL1tixjI9abBKz+UItCQe/F/GwtoJs/takYL2rEufGNRJbT PLRTBuXTVexY+HZiGd53RS7aaZ4MfveLRlck4lbVTs+4nrgBZgHXSnh7t6erqcgnZ7Zv aiQGPztDxijaidCe87EMGdRErn4RZYATnHwrLdbc2qI7hoTpzmOVuPpda5nwARpajJAh bRdv49fsqTHhubPAnUDNCG1sXDeTyTFzyL0mhQE2yIU20q517CP5QSlEP/EqIl0RpfKe i+HXaVf7iEp2WCv2uwWJgw0KnNAxDGBhGEfwfekw4BG7g1CuggQhnMZdjDWG725B5Gkc w90Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=KcsRdEhCEWuA2oxqFTOi/En70y4wwOfq3wTyKpaSxdY=; fh=UD1ZRCSS/l4PYbuMk1gSsIJwAKOC33PKfkYvw4GUlo4=; b=XTyi6XiLSO6Nwg9qLdhq8Ii+cieYgYM6okL2mQ5DwfplLXR5Vc5t9S3zfJRmaWTOjg eB3wUfUuJvbpwXc/uk1UnYZAoHzwzeSIdyUpIJ2JjNmdt3dssIaZ+ON+P6Gu19lb4j6g BK4DkG9ew5br1wncz0uyafqTfNb679TyP5V9x9wBA8Bcl6jULvBca4V6MZ07v3BdEfAR bRdqoS8mMcbMAlc9G08m8yTrORZ/mEOAaECaAIhUVXtfhd3ArFykoHyLBMd3SaxvyrLY uov2Xc9+9Dka1NmgebVOuejkFC0oJcVdcHJOO7fI0cqBRSFxk8Pp23DqwHSa3fSk8COI ifEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4VA5GbcJ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y12-20020a17090a86cc00b00283a54ed475si1115349pjv.110.2023.11.29.03.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:23:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4VA5GbcJ; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C6F9E805F2C8; Wed, 29 Nov 2023 03:23:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233128AbjK2LW4 (ORCPT + 99 others); Wed, 29 Nov 2023 06:22:56 -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: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:23:15 -0800 (PST) The following commit has been merged into the x86/cpu branch of tip: Commit-ID: affc66cb96f865b3763a8e18add52e133d864f04 Gitweb: https://git.kernel.org/tip/affc66cb96f865b3763a8e18add52e133d864f04 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 == 0x19 && !cpu_has(c, X86_FEATURE_BTC_NO)) - set_cpu_cap(c, X86_FEATURE_BTC_NO); } } @@ -1094,6 +1086,15 @@ static void init_amd_zen2(struct cpuinfo_x86 *c) 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); + } } static void init_amd_zen4(struct cpuinfo_x86 *c)