Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp29867imm; Fri, 21 Sep 2018 17:26:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV61khyomGHGbWcMqK9EkZ8o7V3fDZ3AVLIXl9e409o2Et4RvA1kj3ZM6Oa17ir8SdI3GBR7o X-Received: by 2002:a63:4e4e:: with SMTP id o14-v6mr116089pgl.181.1537575963684; Fri, 21 Sep 2018 17:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537575963; cv=none; d=google.com; s=arc-20160816; b=Q4GddOKkQrTHP/BjDJ62lcIunCvMScTIyU5BqE6OM5wXriF7A2WUdjsOSwN0vVLruT +OSl/WA7xVtgAKZHQ+fILSaTt0h1iWJpFduCiwLGl35ws/StaSHnBJdrp5n4mS7+PJNp CWeYu0GPvzMA2A3QnojGUwoQ2QEf3CTALCp2SvQahEepSUrYLiBsIKognaic8G37hpte DHF8GJj3t4bCiAhngAp8kdzQjyNR+6tAzIem6kEPvfZgc+33NLHQjXDpYbF9toLZy2Sc 5BW3TmgiRTtu/Yc+mAkS0IkuHKnOA7E8yWJYoOlVToSGek99oaoUSJ+mH3y9hM+fYKQs 66Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=nU4tdsxg1CxSHXLSP8MqKPvJUYAszYWW2vUAIxvblE0=; b=RTS7+KIQL3KACIsizN8Axn2f2V4GPEics7yseKmalYdUmx+efl+2qKvm0qAmVsm2Ya moM22I9R1ycDaccnGTiGSWjkzaadtK8qT2oGw7uR7XoUPjkv0KmKOjC3XSMeTRZkzjV7 ICqU+LydnfiiLBu3udFYaT1eqgkh2tvvMhlN055dGfrphYvJgtCV19H8MKG2anPOxGvy 1fYpVKqnabC48xjbxv8+S/dS9vjIjPc/6lJgUh/pdz9Kui4PXCTVJ30il8S3qw1Yvb/J BTHQsB97XGqQPFcT0yI1RMrspMS7IV3wq122tcXhT9Immt8ErkG80XI7hMqfZC3OapAD 8Dww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z68-v6si29518907pfz.163.2018.09.21.17.25.48; Fri, 21 Sep 2018 17:26:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392257AbeIVGP7 (ORCPT + 99 others); Sat, 22 Sep 2018 02:15:59 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:44159 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391935AbeIVGKp (ORCPT ); Sat, 22 Sep 2018 02:10:45 -0400 Received: from [2a02:8011:400e:2:cbab:f00:c93f:614] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1g3Vdv-0008BR-Af; Sat, 22 Sep 2018 01:19:27 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1g3Vdp-0000uW-88; Sat, 22 Sep 2018 01:19:21 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Linus Torvalds" , "Thomas Gleixner" , "Sherry Hurwitz" , "Peter Zijlstra" , "David Woodhouse" , "Ingo Molnar" , "Greg Kroah-Hartman" , "Borislav Petkov" Date: Sat, 22 Sep 2018 01:15:42 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 60/63] x86/cpu/AMD: Fix erratum 1076 (CPB bit) In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:cbab:f00:c93f:614 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.58-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov commit f7f3dc00f61261cdc9ccd8b886f21bc4dffd6fd9 upstream. 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 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 Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: - Change the added case into an if-statement - s/x86_stepping/x86_mask/] Signed-off-by: Ben Hutchings --- arch/x86/kernel/cpu/amd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -533,6 +533,16 @@ static void init_amd_ln(struct cpuinfo_x msr_set_bit(MSR_AMD64_DE_CFG, 31); } +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) { u32 dummy; @@ -611,6 +621,9 @@ static void init_amd(struct cpuinfo_x86 clear_cpu_cap(c, X86_FEATURE_MCE); #endif + if (c->x86 == 0x17) + init_amd_zn(c); + /* Enable workaround for FXSAVE leak */ if (c->x86 >= 6) set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK);