Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933199AbbFIQfF (ORCPT ); Tue, 9 Jun 2015 12:35:05 -0400 Received: from mail-bl2on0104.outbound.protection.outlook.com ([65.55.169.104]:40686 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933082AbbFIQez (ORCPT ); Tue, 9 Jun 2015 12:34:55 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NPORDV-07-7F2-02 X-M-MSG: From: Aravind Gopalakrishnan To: , , CC: , , , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Jacob Shin , Dave Hansen , Andy Lutomirski , "Paolo Bonzini" , Denys Vlasenko , "Hector Marco-Gisbert" Subject: [PATCH 2/3] x86, amd: Provide accessor for number of nodes Date: Tue, 9 Jun 2015 11:45:16 -0500 Message-ID: <1433868317-18417-3-git-send-email-Aravind.Gopalakrishnan@amd.com> X-Mailer: git-send-email 2.4.0 In-Reply-To: <1433868317-18417-1-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1433868317-18417-1-git-send-email-Aravind.Gopalakrishnan@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11OLC007;1:qthoTfF5RhGBzOn0MJmkVtFN9L9/DOJO2/mCpJtqejZTWDDOlKlFPI5dVFcWzZrw/JoZu2W0KHjiYb5oe2R1wyATbBkKYcDlpmdpnTV/T+LTGc4tJD7bfhZhrdY7fptrjQwE+fzCg0ASBguSuipyEG80JwwjvzHFaj2gwglJzREUXnXqsu1I0ot+HFSBM1HH/ELLIZEOg/mjMvU3g0MP4DP5umnWJIw8nYoBJBM4jq3wbSwBkkLsGwmZg5ISDs95S7UtYUWyE7LbfVfvLJxH/8PZZ33DHQKN7gUMroNVwI9uB1KscIpTRafemMjXBEO4+HWX5PplnK3K4s8Omu4wNQ== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(189002)(199003)(50226001)(50986999)(87936001)(101416001)(77096005)(53416004)(19580395003)(19580405001)(86362001)(76176999)(47776003)(48376002)(50466002)(77156002)(62966003)(36756003)(2950100001)(5001770100001)(189998001)(229853001)(2201001)(105586002)(46102003)(92566002)(106466001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR02MB1120;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1120; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:CY1PR02MB1120;BCL:0;PCL:0;RULEID:;SRVR:CY1PR02MB1120; X-Forefront-PRVS: 06022AA85F X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2015 16:34:45.0099 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1120 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1912 Lines: 59 Add an accessor function amd_get_nodes_cnt() which returns the number of nodes per socket. In a subsequent patch, we will use this info in EDAC mce_amd_inj module. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Borislav Petkov Cc: Jacob Shin Cc: Dave Hansen Cc: Andy Lutomirski Cc: Paolo Bonzini Cc: Denys Vlasenko Cc: Hector Marco-Gisbert Signed-off-by: Aravind Gopalakrishnan --- arch/x86/include/asm/processor.h | 1 + arch/x86/kernel/cpu/amd.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 8e04f51..34faf24 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -820,6 +820,7 @@ static inline int mpx_disable_management(struct task_struct *tsk) #endif /* CONFIG_X86_INTEL_MPX */ extern u16 amd_get_nb_id(int cpu); +extern u32 amd_get_nodes_cnt(void); static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves) { diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 487083b..788655a 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -373,6 +373,12 @@ u16 amd_get_nb_id(int cpu) } EXPORT_SYMBOL_GPL(amd_get_nb_id); +u32 amd_get_nodes_cnt(void) +{ + return nodes_per_processor; +} +EXPORT_SYMBOL_GPL(amd_get_nodes_cnt); + static void srat_detect_node(struct cpuinfo_x86 *c) { #ifdef CONFIG_NUMA -- 2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/