From patchwork Wed Nov 29 11:22:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 171268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp267626vqn; Wed, 29 Nov 2023 03:22:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJk7wLfesdE8IgzN+vqcDNsVYQ15bTFyKUv+nTiqoASSjOE3Hs3vaI9PGehjkcrJ3u3Cwk X-Received: by 2002:a05:6870:6488:b0:1fa:1f05:6526 with SMTP id cz8-20020a056870648800b001fa1f056526mr19085569oab.44.1701256964651; Wed, 29 Nov 2023 03:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701256964; cv=none; d=google.com; s=arc-20160816; b=QKQe0VPthP2q4o6yeIib6rzAGvCnk6aH9FMuxHinpKpekXMHSIpBK+Vu1jgAWm4piO l/gD8dt4TGnvCYXquD2n1ZOFGYMnZU3RJNOcyYZhvsMkGwhfVyi3YyzACI5lwQM2nsAa IXusaqOlMvJFkXdM6Thz4HOSBM3qoi4nu2riPAjsE26M8rua65zzTeU42ACfIZPoE7Md gPGlgVtkzEOarCUp1rAGlEeC4jcSsxZPdpOf4YJR1fsylaqtU8/tUjn9TWbBuTbweUJ3 YG96E+A5I5Z+N5oNG2cSZ1xq75T7cSUKQxqNpYxEyT87La0EYa4bpcW0nDOng8B4SyaC CXtw== 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=hgsSLktVnVLWUAoHl8Zsn2zYL7+t5Ae+iJ8uyuFak0s=; fh=UD1ZRCSS/l4PYbuMk1gSsIJwAKOC33PKfkYvw4GUlo4=; b=fHp+VB3CS1Z0IDK/saNU5Upn82v1ANjiYb9ZXBcD9WXLlJhXp+4Tu/TRLY2A50wXwE AV9yPoJhBA+iCGDvzXSznhHPAZsHfiK0b1LH1k3N1IiqPb7itJUvH1YhTsNtnLMkGsSf 1zSBdGkYyE65/tJsUiIM8UZTAP8unwDhri66Drkr9NnJyfXYbfh32nNuJEMG+V2bFaJE +3JamXWFAoOSI1uxxhlFuat+pooEB9CEmZgrzfU/uwlJnnZD1pzO2yLNpUEYNKRXN0tF tg9C3Q/JVx/SbsKNF+vJMSSPgw8smpW2JHSd1Jwe5kN4HKGP4/uSdkuGamJaQbKa+Hpj KE/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PsMEnS3C; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id fd1-20020a056a002e8100b006cbdff8f01csi14765816pfb.68.2023.11.29.03.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 03:22:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PsMEnS3C; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id C1938803A523; Wed, 29 Nov 2023 03:22:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232353AbjK2LW3 (ORCPT + 99 others); Wed, 29 Nov 2023 06:22:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231693AbjK2LWX (ORCPT ); Wed, 29 Nov 2023 06:22:23 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD8331999; Wed, 29 Nov 2023 03:22:29 -0800 (PST) Date: Wed, 29 Nov 2023 11:22:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701256946; 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=hgsSLktVnVLWUAoHl8Zsn2zYL7+t5Ae+iJ8uyuFak0s=; b=PsMEnS3C3st1Fd6uW6tDfdXfDbsw9lXHIAyB4qktqeoy5LnQwuT2SMG+ONuBxqyraT0EMd IQhPGdJikLjF/shMmLovWjyG3wHqFKp9GmsnvRA1tSXamjgoqCarXqu9YjtnmTVzuIc24b nmVJEeG5wY/GW7zkc4oERWzRqxQC6rEbSdpUOsO8r+d0dRge48f/6egojSBMAH5MMBZ+K/ O4NgH+il/RZCB7++cNCG962hA1RLP2T+fphWlDiQtD/RYnqfoTB8DioVkXFtCwEJVifuJW 3YzPekzo8sspU3muEZL3MujGurVyTyEd7fFrPpdZj+QYMIrmO0d/FkcNj04LUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701256946; 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=hgsSLktVnVLWUAoHl8Zsn2zYL7+t5Ae+iJ8uyuFak0s=; b=nqpAIP83WGLDO6EENwYQYx6DMf0FPhAA38rQ4xgqAJF5fLL7bUpUvswsxEZX7Mhozqj3y2 rcWFo1HZzixOJ/AA== 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: Get rid of amd_erratum_1485[] Cc: "Borislav Petkov (AMD)" , Nikolay Borisov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231120104152.13740-13-bp@alien8.de> References: <20231120104152.13740-13-bp@alien8.de> MIME-Version: 1.0 Message-ID: <170125694578.398.3923463783976438824.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 03:22:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783079470011343025 X-GMAIL-MSGID: 1783897223411161585 The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 794c68b20408bb6899f90314e36e256924cc85a1 Gitweb: https://git.kernel.org/tip/794c68b20408bb6899f90314e36e256924cc85a1 Author: Borislav Petkov (AMD) AuthorDate: Fri, 03 Nov 2023 23:21:56 +01:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 29 Nov 2023 12:13:31 +01:00 x86/CPU/AMD: Get rid of amd_erratum_1485[] No functional changes. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: http://lore.kernel.org/r/20231120104152.13740-13-bp@alien8.de --- arch/x86/kernel/cpu/amd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 550ac25..f8be7ac 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -59,10 +59,6 @@ static u32 nodes_per_socket = 1; #define AMD_MODEL_RANGE_START(range) (((range) >> 12) & 0xfff) #define AMD_MODEL_RANGE_END(range) ((range) & 0xfff) -static const int amd_erratum_1485[] = - AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x19, 0x10, 0x0, 0x1f, 0xf), - AMD_MODEL_RANGE(0x19, 0x60, 0x0, 0xaf, 0xf)); - static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) { int osvw_id = *erratum++; @@ -1093,6 +1089,9 @@ static void init_amd_zen3(struct cpuinfo_x86 *c) static void init_amd_zen4(struct cpuinfo_x86 *c) { init_amd_zen_common(); + + if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) + msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT); } static void init_amd(struct cpuinfo_x86 *c) @@ -1216,10 +1215,6 @@ static void init_amd(struct cpuinfo_x86 *c) cpu_has(c, X86_FEATURE_AUTOIBRS)) WARN_ON_ONCE(msr_set_bit(MSR_EFER, _EFER_AUTOIBRS)); - if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && - cpu_has_amd_erratum(c, amd_erratum_1485)) - msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT); - /* AMD CPUs don't need fencing after x2APIC/TSC_DEADLINE MSR writes. */ clear_cpu_cap(c, X86_FEATURE_APIC_MSRS_FENCE); }