Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5768257imm; Mon, 23 Jul 2018 05:52:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf53a5mLYOrMPi4VCnzqUaji7zKKtc9rpRxpR8GxC0++RdRw5iJBK+ny1VlDQCwOrWjMNfW X-Received: by 2002:a17:902:20e9:: with SMTP id v38-v6mr12883662plg.107.1532350332917; Mon, 23 Jul 2018 05:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532350332; cv=none; d=google.com; s=arc-20160816; b=U8o+g+cZaw6UC1IVKcnSmLR7w6gwuesjSUYJvvnFhjD0ErLWNELalIspFTjAt8mfIC o4PUVRzdjY0LKSw5m9VjXXNcBtK7pi2O8Y7kaU3mCgFVteQ4l53Hp3mt7Fyj3AvHIaWE 0toVN0Gkm7alTnjaJ4b8mCXk7jkMgRAndW8FAFAkYXhZUFFSAM/Tbjr9i0NBaqbGD+ra +gXUkjMG8Zu3yFJxtrXlCYZeYRQPeoFjYx15JiY6FwNo18nj7s3/1d97SuWGkRxYGVZ3 YZEP9Gxi8Mh4BHGrQ5mYuEZX6qZfcqPB18MR6XiJ/87tgc2I94qd1bzUtEx5A0x9xFHQ CQFg== 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=NFSW15RRmaPHgcUx3Hzb/7vP+A0PDjaiE9Kjwf9DxBQ=; b=MxufnzncnYznIgF9FvALtB7fwdmacZlsswCFdgRo46KehZb0FKY3YPvdMKArt+tRD9 vstfnbCq7MAOV1otF3M4TWQb724dX74aDSScB4/waOavUqQHJLWssU7u6pudAkrcFiq4 gT7gZ7HQe7ffmZuSDuWG3bOB/ZXvicmer0kr8bvksvlgFFVs1yJfwGBaUKoG4r9jI/9P FonPOxR7V5u/28THznf5FIDLvvkk9y3Epp0W2iBi2JXYEun3Yz5y/1zlrgq8dcJLMUJq AYzZ6sR/l3/BGeHDvC3+zQU4ix56SVzfTjwSTuk6blAMoCdAx3E4k7OADu4AaLfpSGrC PLHw== 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 24-v6si8565191pgx.314.2018.07.23.05.51.58; Mon, 23 Jul 2018 05:52:12 -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 S2388770AbeGWNvd (ORCPT + 99 others); Mon, 23 Jul 2018 09:51:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51470 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388503AbeGWNsB (ORCPT ); Mon, 23 Jul 2018 09:48:01 -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 8A1D0C7D; Mon, 23 Jul 2018 12:46:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , Borislav Petkov , Konrad Rzeszutek Wilk , David Woodhouse , "Srivatsa S. Bhat" , "Matt Helsley (VMware)" , Alexey Makhalov , Bo Gan Subject: [PATCH 4.4 087/107] x86/cpufeatures: Add FEATURE_ZEN Date: Mon, 23 Jul 2018 14:42:21 +0200 Message-Id: <20180723122417.849391755@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: Thomas Gleixner commit d1035d971829dcf80e8686ccde26f94b0a069472 upstream Add a ZEN feature bit so family-dependent static_cpu_has() optimizations can be built for ZEN. Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Reviewed-by: Konrad Rzeszutek Wilk 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/include/asm/cpufeatures.h | 2 ++ arch/x86/kernel/cpu/amd.c | 1 + 2 files changed, 3 insertions(+) --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -213,6 +213,8 @@ #define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */ #define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */ #define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */ +#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */ + /* Virtualization flags: Linux defined, word 8 */ #define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */ --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -715,6 +715,7 @@ static void init_amd_bd(struct cpuinfo_x static void init_amd_zn(struct cpuinfo_x86 *c) { + set_cpu_cap(c, X86_FEATURE_ZEN); /* * Fix erratum 1076: CPB feature bit not being set in CPUID. It affects * all up to and including B1.