Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5768671imm; Mon, 23 Jul 2018 05:52:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe0Gs7N4wg8GT8UzB7aWJsOYByjPIPiKfv6tfaxrIEZEvlCWS573r0P7PtrSsEKWqEE42pJ X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr11752296pgl.397.1532350363253; Mon, 23 Jul 2018 05:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532350363; cv=none; d=google.com; s=arc-20160816; b=olg3lIrRz6CYUQd3Rbzpd9CatYOt5dKFOzzaGsO5cKKvSOApZOfWNK6IF8VkNVaQnp flPT6MWH/kEifTJIwAjFCf2C8YGbt4ugaBiO/2kz0ywQeawru8CiH6Q5pwZ6XohCJoEt oxRUcLCAnjfcdf1Buy1OqFhwJJ5vGDFq5NsP1Se5cRRAENGhmb0eLxVhM+uiM7T/+Iha /rqWFtNdVICXGZnOWRmUy2RPSBZDyfbcZ+OaqZI5Wx0cwbF2mhsfk/SM17cZQHcgfOph rKpgv9wNqTS0/IHqZu7XlI0UEIY3kx8oqtr2oNsK5sl2/f9/g4wBA6en6cae6Mu/ulXc oSLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=or0ttgXzqw4yjfdMLCwVBlcbolQGSRa7ErpnUZYVqig=; b=BquLDNBmWgz5hiitTRkJvyOB2++O9CYQJEKEkKFi497WuAdMiLjIGSBIOFEgKSSCnx LyHVW4kvJjdePc+mFI+qmkK24YhN6McqyTzOg1WB4Xm9AblXpQKrRWvSx87hREvPMUm9 d5OoGLIarma9aZ8ZzjcCOV3qOuu3YdFFCg9hoojRH+uUM/OqwjO9+HZX8Q3aDKfCVWY4 alpnja6OItCC1f4rUmeHa6Mo+lCLAHoDN3wc1cOkyALUl3Hb3We79hsCMatFydsSv7XB KO97XdKcH4oT1Simf3+MjCg7zynoL7nTxBSNsPYxC/Y3WzPl4wDsvR4MEofiy6S3L1Co a39w== 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 u4-v6si8161304pgu.546.2018.07.23.05.52.28; Mon, 23 Jul 2018 05:52:43 -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 S2389573AbeGWNsB (ORCPT + 99 others); Mon, 23 Jul 2018 09:48:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51200 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388674AbeGWNsA (ORCPT ); Mon, 23 Jul 2018 09:48:00 -0400 Received: from localhost (LFbn-1-12238-233.w90-92.abo.wanadoo.fr [90.92.53.233]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BFB78C96; Mon, 23 Jul 2018 12:46:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Linus Torvalds , Peter Zijlstra , Sherry Hurwitz , Thomas Gleixner , Ingo Molnar , David Woodhouse , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 086/107] x86/cpu/AMD: Fix erratum 1076 (CPB bit) Date: Mon, 23 Jul 2018 14:42:20 +0200 Message-Id: <20180723122417.789791295@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180723122413.003644357@linuxfoundation.org> References: <20180723122413.003644357@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable 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 Signed-off-by: Srivatsa S. Bhat Reviewed-by: Matt Helsley (VMware) Reviewed-by: Alexey Makhalov Reviewed-by: Bo Gan Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/amd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -713,6 +713,16 @@ static void init_amd_bd(struct cpuinfo_x } } +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; @@ -743,6 +753,7 @@ static void init_amd(struct cpuinfo_x86 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 */