From patchwork Thu Jun 2 00:11:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Hansen X-Patchwork-Id: 9148873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 724A8600BC for ; Thu, 2 Jun 2016 00:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63C86271E0 for ; Thu, 2 Jun 2016 00:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58175271FD; Thu, 2 Jun 2016 00:17:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0710271E0 for ; Thu, 2 Jun 2016 00:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675AbcFBAMF (ORCPT ); Wed, 1 Jun 2016 20:12:05 -0400 Received: from mga02.intel.com ([134.134.136.20]:63616 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbcFBAMB (ORCPT ); Wed, 1 Jun 2016 20:12:01 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 01 Jun 2016 17:11:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,403,1459839600"; d="scan'208";a="979083430" Received: from viggo.jf.intel.com (HELO localhost.localdomain) ([10.54.39.121]) by fmsmga001.fm.intel.com with ESMTP; 01 Jun 2016 17:11:58 -0700 Subject: [PATCH 01/20] x86, intel: Introduce macros for Intel family numbers To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Dave Hansen , dave.hansen@linux.intel.com, adrian.hunter@intel.com, ak@linux.intel.com, luto@kernel.org, bp@alien8.de, dvhart@infradead.org, dougthompson@xmission.com, edubezval@gmail.com, hpa@zytor.com, mingo@redhat.com, jacob.jun.pan@linux.intel.com, kan.liang@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-edac@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.org, mchehab@osg.samsung.com, peterz@infradead.org, platform-driver-x86@vger.kernel.org, rafael.j.wysocki@intel.com, rajneesh.bhardwaj@intel.com, souvik.k.chakravarty@intel.com, srinivas.pandruvada@linux.intel.com, eranian@google.com, tglx@linutronix.de, tony.luck@intel.com, ulf.hansson@linaro.org, viresh.kumar@linaro.org, vishwanath.somayaji@intel.com, zheng.z.yan@intel.com, rui.zhang@intel.com From: Dave Hansen Date: Wed, 01 Jun 2016 17:11:57 -0700 Message-Id: <20160602001157.D8BE59D7@viggo.jf.intel.com> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Hansen If you are cc'd on this code, please check _your_ code vs. the model list in "intel-family.h". Please make sure you have all the models listed that you intend to. Problem: We have a boatload of open-coded family-6 model numbers. Half of them have these model numbers in hex and the other half in decimal. This makes grepping for them tons of fun, if you were to try. Solution: Consolidate all the magic numbers. Put all the definitions in one header. The names here are closely derived from the comments describing the models from arch/x86/events/intel/core.c. We could easily make them shorter by doing things like s/SANDYBRIDGE/SNB/, but they seemed fine even with the longer versions to me. Do not take any of these names too literally, like "DESKTOP" or "MOBILE". These are all colloquial names and not precise descriptions of everywhere a given model will show up. Signed-off-by: Dave Hansen Cc: Adrian Hunter Cc: Andi Kleen Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Darren Hart Cc: Doug Thompson Cc: Eduardo Valentin Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Jacob Pan Cc: Kan Liang Cc: Len Brown Cc: linux-acpi@vger.kernel.org Cc: linux-edac@vger.kernel.org Cc: linux-mmc@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: Mauro Carvalho Chehab Cc: Peter Zijlstra Cc: platform-driver-x86@vger.kernel.org Cc: Rafael J. Wysocki Cc: Rajneesh Bhardwaj Cc: Souvik Kumar Chakravarty Cc: Srinivas Pandruvada Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Tony Luck Cc: Ulf Hansson Cc: Viresh Kumar Cc: Vishwanath Somayaji Cc: Yan, Zheng Cc: Zhang Rui Acked-by: Darren Hart Acked-by: Rafael J. Wysocki --- b/arch/x86/include/asm/intel-family.h | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff -puN /dev/null arch/x86/include/asm/intel-family.h --- /dev/null 2016-04-04 09:40:43.435149254 -0700 +++ b/arch/x86/include/asm/intel-family.h 2016-06-01 15:45:02.877884645 -0700 @@ -0,0 +1,57 @@ +#ifndef _ASM_X86_INTEL_FAMILY_H +#define _ASM_X86_INTEL_FAMILY_H + +/* + * "Big Core" Processors (Branded as Core, Xeon, etc...) + * + * The "_X" parts are generally the EP and EX Xeons, or the + * "Extreme" ones, like Broadwell-E. + */ + +#define INTEL_FAM6_MODEL_CORE_YONAH 0x0E +#define INTEL_FAM6_MODEL_CORE2_MEROM 0x0F +#define INTEL_FAM6_MODEL_CORE2_MEROM_L 0x16 +#define INTEL_FAM6_MODEL_CORE2_PENRYN 0x17 +#define INTEL_FAM6_MODEL_CORE2_DUNNINGTON 0x1D +#define INTEL_FAM6_MODEL_NEHALEM 0x1E +#define INTEL_FAM6_MODEL_NEHALEM_EP 0x1A +#define INTEL_FAM6_MODEL_NEHALEM_EX 0x2E +#define INTEL_FAM6_MODEL_WESTMERE 0x25 +#define INTEL_FAM6_MODEL_WESTMERE_EP 0x2C +#define INTEL_FAM6_MODEL_WESTMERE_EX 0x2F +#define INTEL_FAM6_MODEL_SANDYBRIDGE 0x2A +#define INTEL_FAM6_MODEL_SANDYBRIDGE_X 0x2D +#define INTEL_FAM6_MODEL_IVYBRIDGE 0x3A +#define INTEL_FAM6_MODEL_IVYBRIDGE_X 0x3E +#define INTEL_FAM6_MODEL_HASWELL_CORE 0x3C +#define INTEL_FAM6_MODEL_HASWELL_X 0x3F +#define INTEL_FAM6_MODEL_HASWELL_ULT 0x45 +#define INTEL_FAM6_MODEL_HASWELL_GT3E 0x46 +#define INTEL_FAM6_MODEL_BROADWELL_CORE_M 0x3D +#define INTEL_FAM6_MODEL_BROADWELL_XEON_D 0x56 +#define INTEL_FAM6_MODEL_BROADWELL_GT3E 0x47 +#define INTEL_FAM6_MODEL_BROADWELL_X 0x4F +#define INTEL_FAM6_MODEL_SKYLAKE_MOBILE 0x4E +#define INTEL_FAM6_MODEL_SKYLAKE_DESKTOP 0x5E +#define INTEL_FAM6_MODEL_SKYLAKE_X 0x55 +#define INTEL_FAM6_MODEL_KABYLAKE_MOBILE 0x8E +#define INTEL_FAM6_MODEL_KABYLAKE_DESKTOP 0x9E + +/* "Small Core" Processors (Atom) */ + +#define INTEL_FAM6_MODEL_ATOM_PINEVIEW 0x1C +#define INTEL_FAM6_MODEL_ATOM_LINCROFT 0x26 +#define INTEL_FAM6_MODEL_ATOM_PENWELL 0x27 +#define INTEL_FAM6_MODEL_ATOM_CLOVERVIEW 0x35 +#define INTEL_FAM6_MODEL_ATOM_CEDARVIEW 0x36 +#define INTEL_FAM6_MODEL_ATOM_SILVERMONT1 0x37 +#define INTEL_FAM6_MODEL_ATOM_SILVERMONT2 0x4D /* Avaton/Rangely */ +#define INTEL_FAM6_MODEL_ATOM_AIRMONT 0x4C +#define INTEL_FAM6_MODEL_ATOM_GOLDMONT 0x5C +#define INTEL_FAM6_MODEL_ATOM_DENVERTON 0x5F /* Goldmont Microserver */ + +/* Xeon Phi */ + +#define INTEL_FAM6_MODEL_XEON_PHI_KNL 0x57 /* Knights Landing */ + +#endif /* _ASM_X86_INTEL_FAMILY_H */