From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbdIOItW (ORCPT ); Fri, 15 Sep 2017 04:49:22 -0400 Received: from terminus.zytor.com ([65.50.211.136]:47313 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbdIOItV (ORCPT ); Fri, 15 Sep 2017 04:49:21 -0400 Date: Fri, 15 Sep 2017 01:45:42 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, bp@suse.de, torvalds@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, dzickus@redhat.com, sherry.hurwitz@amd.com Reply-To: torvalds@linux-foundation.org, tglx@linutronix.de, bp@suse.de, sherry.hurwitz@amd.com, mingo@kernel.org, dzickus@redhat.com, peterz@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <20170907170821.16021-1-bp@alien8.de> References: <20170907170821.16021-1-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/cpu/AMD: Fix erratum 1076 (CPB bit) Git-Commit-ID: 6a707c0e451cb8d86943b840939e2ed881b8023e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 6a707c0e451cb8d86943b840939e2ed881b8023e Gitweb: http://git.kernel.org/tip/6a707c0e451cb8d86943b840939e2ed881b8023e Author: Borislav Petkov AuthorDate: Thu, 7 Sep 2017 19:08:21 +0200 Committer: Ingo Molnar CommitDate: Fri, 15 Sep 2017 07:44:50 +0200 x86/cpu/AMD: Fix erratum 1076 (CPB bit) CPUID Fn8000_0007_EDX[CPB] is wrongly 0 on models up to B1. But they do support CPB (AMD's Core Performance Boosting cpufreq CPU feature), so fix that. Signed-off-by: Borislav Petkov Reviewed-by: Don Zickus Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sherry Hurwitz Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20170907170821.16021-1-bp@alien8.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/amd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 9862e2c..d58184b 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -763,6 +763,16 @@ static void init_amd_bd(struct cpuinfo_x86 *c) } } +static void init_amd_zn(struct cpuinfo_x86 *c) +{ + /* + * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects + * all up to and including B1. + */ + if (c->x86_model <= 1 && c->x86_mask <= 1) + set_cpu_cap(c, X86_FEATURE_CPB); +} + static void init_amd(struct cpuinfo_x86 *c) { early_init_amd(c); @@ -791,6 +801,7 @@ static void init_amd(struct cpuinfo_x86 *c) case 0x10: init_amd_gh(c); break; case 0x12: init_amd_ln(c); break; case 0x15: init_amd_bd(c); break; + case 0x17: init_amd_zn(c); break; } /* Enable workaround for FXSAVE leak */