Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755314AbdGXJXe (ORCPT ); Mon, 24 Jul 2017 05:23:34 -0400 Received: from mail-sn1nam02on0075.outbound.protection.outlook.com ([104.47.36.75]:60855 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752026AbdGXJXG (ORCPT ); Mon, 24 Jul 2017 05:23:06 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; From: Suravee Suthikulpanit To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, bp@suse.de, peterz@infradead.org, Yazen.Ghannam@amd.com, Suravee Suthikulpanit Subject: [PATCH v4 1/2] x86/amd: Refactor topology extension related code Date: Mon, 24 Jul 2017 04:22:44 -0500 Message-Id: <1500888165-2345-2-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500888165-2345-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1500888165-2345-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CO1PR15CA0049.namprd15.prod.outlook.com (10.175.176.17) To CY4PR12MB1735.namprd12.prod.outlook.com (10.175.62.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6649ac1-f92c-4266-4c8b-08d4d275957c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR12MB1735; X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1735;3:7mkCoqlIOaXVXjbZ5FoF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meFK4xm2+xFHmAiRYO/QFG1td/x7zNpL17XosrLr3xUJDKSC07CefSIr0DLkZmnFVpwpuR3zK2PGQkUJe9Qo7DkXwgPc4sflE/I1ZV67fFF4uFjIp54AQ9C1QTS9t2QAJcAVIjsUlznDpn0fAk4S+dZDnj3LEkIdmxGtWMQHlJj93JtFbYFTjAh4q/VBszlQKuOoqaU32+o00eNFYpCVvBNAeSCy2nPuMaYv5JZ7aWTGc7Xfbu6l9MLq6lirJ9DMkXo/Emk57IXzT4ES1pUJBzG64JMQDSCwlpzs+dinf2tGPIJv34Z1x2w9JXGb2D2quYVxsYSMwZ1vDkYHvqQ7c= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1735;20:TqemSx/Sp1Kve7YKLNuvzU+Tx4otBYWMbjD5c/CKkO7TUP9QwzsAxLbYAhM+dukBX7SdgMfhEDX8/JVprVKp5KUWafR99L1A/fY7lcTjE9VgZ99ursC96slq/AvbD7tDy3WKIVf26MvtEEDto9dFtDgC9SGpeC+05vT6LDXmOFXO8YpofvbDrT8KMM8WEjhgwBeqxe6O8ZxO/IGBrhJZq4lSbgVnpOQrezn+1VR4TLZLqvKqFS9J19E3HFeWU1ct8ZLiAOy57DUu5a3z3sZM2879lqPIvwLBWJ4E+Whrx8RLbbXA3/X/+4k3jFn1KhoTX6Y9B/gfY2RCWoNJzeLsYFxTEwH0WO5rp19CSa+RTtPqF9zy2tzpXN7VFmJXEbB5LGuPc0608lMtoVrN6WaMjvuGGUOHAHLDBBNzszYOG35iaj6iAEX8mtl+B81KTDsZqxN3fhJBezVC2WxuVnM/tmzVPeo1KlrQZEDpvXgKsVyckziCy5W7n/257ciN1pEr X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR12MB1735;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR12MB1735; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR12MB1735;4:CjMoJLFyJDJhLEo18YjgvAFJ3pD3ttJLsbMbyqzLBQ?= =?us-ascii?Q?zOl+9OB1wdeKM9KkRtate2JJBRIeJdviTZTdJIAj0hRgpV2k2uUJPd7J6cW1?= =?us-ascii?Q?l1BDTQXzzvlM84jjv6Daob7Ow9verYYZDHGYJo8jWc71R7WCaBhHykQqOMda?= =?us-ascii?Q?EnS0i6scGl+g+wWMX5VUvfbVj5sZPy3MWFsCSSuM4mi0SjImwXzlFqyfXk3t?= =?us-ascii?Q?bFjWR4WXF/QaTXno8u2PpJONSAL3rK8Qui2qBqCOCjNRZTx3ktqNply7TOdG?= =?us-ascii?Q?COlT47G8ZOaxdPJyEcz/EU9WtNUWYStUnpNKlirB2EATBufJ2oWvuu6AKGiX?= =?us-ascii?Q?WCMzLxAgexvcBs8+QZZNIqViedpNNZ8w139/Qmorvhq7AHF4OAh1x0g1bd3J?= =?us-ascii?Q?aYA/4zSSkXiqjg52JOdOtnEb5wpm+bkO+jjgTYLG9XwVghnZRLN1ge8Vu64V?= =?us-ascii?Q?nLR8VmGzyWsBIt0tYVz5vja5HaO8W5gzYWpsaZ8a/TNlu3rmWUpVph1JRTpP?= =?us-ascii?Q?OVKVm7Yb9rgwzX6qQ+CsQrZTntAeEJ9iKMNFcZtS4iqyh5thq3vcIVodEwf3?= =?us-ascii?Q?86tsaTCbKkW1HWtITprao/VOiwb6tl/yyCeQaBn+yw5zBiyyO0n+HiZH69U0?= =?us-ascii?Q?faMxjCmDtvEmhEbtVy6abnpdPTONUv5hX/B3V6O5e86LRLmsEpXBBpnS7Ww0?= =?us-ascii?Q?vquL67twjDtkENlx9kx5gHMro+26wPNlII8Mm+mGLR6ClXzfcDuAwco6keyZ?= =?us-ascii?Q?cKmNPoi33lL4Z5HNdpkek9Iz3vU2iZVs8Wf/znYzN9+HNpYgMPD89MHjNoF2?= =?us-ascii?Q?8L3sSMZWpQ/SsUN8/w6BCkMDg8A8/3WH0ahyOLPb/DgVsz5GjBTSwq5kvFwq?= =?us-ascii?Q?cUOshrdYXVRELznoGeALEuzleNerQisa8X2Dwe+lvoy+hM/Ou+j2us004Pto?= =?us-ascii?Q?C8Qh7lmNZZs815JByMcrswoAqcVN0VihJaIUsTw9jUplGKR1Lcd1/7eUMz1j?= =?us-ascii?Q?XmL03zUYOvAe7kleVb5LL7/VDNslaL1ptXQk4EDjbrLG5USEYnWz6u9kxuLd?= =?us-ascii?Q?X8Lo3/JlBEiyY0/y9DHsnLCAfww0KX75v/1taTs3fkP/i7tSv+KHuwJ3euls?= =?us-ascii?Q?+a2vOr4vsF4Sn14DU0CdrQUtgq2t4HcEwHpRaDiPWmORIqbS4feRzZTnJERh?= =?us-ascii?Q?OcbDwxb2HlKjbOVmghvFMhoASvrl9/7tnU?= X-Forefront-PRVS: 0378F1E47A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(39410400002)(39400400002)(39850400002)(39450400003)(39840400002)(189002)(199003)(53416004)(50466002)(6486002)(81166006)(81156014)(42186005)(7736002)(105586002)(6116002)(97736004)(8676002)(53936002)(50226002)(33646002)(48376002)(3846002)(106356001)(86362001)(5003940100001)(38730400002)(110136004)(6666003)(305945005)(2950100002)(7350300001)(66066001)(68736007)(72206003)(4326008)(478600001)(101416001)(50986999)(5660300001)(36756003)(47776003)(76176999)(189998001)(25786009)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR12MB1735;H:ssuthiku-ubuntu-b2.amd.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR12MB1735;23:9Zu80NzFnI33OWT98UpBP2aWqAjQrGY8QIoJ86uY8?= =?us-ascii?Q?jmYO3L2AQGHJU4ACa3/ngCBft0qfv/iWXS3y8d1ZBtGb4FqnoOjisMsr1aCH?= =?us-ascii?Q?AziX43T721j/zvlNBPxaVbi6QOGy8wz+tWSthoSlxY7RyjerZjp4Yh7FFOA9?= =?us-ascii?Q?suN3JT0F/GPbj/JGq4vGeoq7hFrjwM3FjDsOqEN2Nn/p3qOltYP+DJ7luF5O?= =?us-ascii?Q?WMQxSc6VLuPevhcbaPr+d3tAcDwMMEYrO1lZQguBkmbkgfvFcv7e0iyZh2Zo?= =?us-ascii?Q?heuiNnFWP5ICnHK7I3YzIRuHVhIaeyPFkD+cMA0xRXlCIhzPMU5++IT/gX0u?= =?us-ascii?Q?zimWdBuvY61GfRlm+jYZpe9k1D5e3zafPE66jhsAdBfVAifRwxbEOd7QX/lT?= =?us-ascii?Q?w6muabEmk3Av9cHoEIfbY2wDJt41mKiBUiOf82r87TAsP25lPEYeD2NkFi+l?= =?us-ascii?Q?gamlGZI1Q72pdLiNtfWKgVQfpCsDaXwNGCOVNdPlTgmcpBbMvSD0Ic2YnUN+?= =?us-ascii?Q?0apArmQqbR7gZHtjLQrx0aHTgvKsKUIVcqu+UcirX2hppNtUsjyhECaiMJVz?= =?us-ascii?Q?Zq0ovF0dZTgpkNYytC0DUrWjrMoz7mirQoUD/0sHPWdfvqPywOOYCHSU8k3w?= =?us-ascii?Q?ui+MPyeNn2JDfgC85a6xx8U/GcgFhhwrp/lI9aR5/hf33uvhsi+J/29otwbi?= =?us-ascii?Q?QoiKFarVI5zkTZuZkBS1PIcPH0kIdeznVM01NO3b1HTssUtGjDL35qAyf50t?= =?us-ascii?Q?ZOOjtuMbU+uoHMVO5A7GIka2ZV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IUi12SHEWJT6utgpT55AkKtV5fiszdBrfOmHKSftZIV+thtnMTKBjhhyHTZs15dl02lac/SaybL2I/W/OWH+h7Vx2HMwUwvZk8wi9qudsePkZp8SFnNPAX3Q8L88GaYmsrWVy2Vp/sCKVe99v/s1cn0bmLxLRrBA3w8735+mIQKggpCQ1qxU347g2U39lExd3Isvo44EbsVXQBR09nKMXgnLzQDewuLgAwFUYA= X-Microsoft-Exchange-Diagnostics: 1;CY4PR12MB1735;20:CwPA1ZSPEcnJ2gRLc/cqGrlm5V+pw9mZGI6UGWoiLptgfF3co46S+nXQArCaAnfL6Pbhfl8SHLvxWX/rxnlUEFXv/tjh5677YXfNlcrSLa0zHlVBl65u/EwgCVSgzvzrdsqM7Ub0ayLDKthIdysU3qTlqNGpmWxlYHjXczmCWXQE3wnixW7KqqHAEGVAFF2xW68x/2RL8MIzJsWyHTAM7hfmLQRVryQFq/D2cCWaZMMCsy9bJzgRCqbt06zirlDR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2017 09:23:01.6415 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1735 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2846 Lines: 114 From: Borislav Petkov Refactoring in preparation for subsequent changes. There is no functional change. Signed-off-by: Suravee Suthikulpanit --- arch/x86/kernel/cpu/amd.c | 78 ++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 34 deletions(-) diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index bb5abe8..a2a52b5 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -296,13 +296,55 @@ static int nearby_node(int apicid) } #endif +#ifdef CONFIG_SMP + +/* + * Get topology information via X86_FEATURE_TOPOEXT. + */ +static void __get_topoext(struct cpuinfo_x86 *c, int cpu) +{ + u32 eax, ebx, ecx, edx; + u8 node_id; + + cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); + + node_id = ecx & 0xff; + smp_num_siblings = ((ebx >> 8) & 0xff) + 1; + + if (c->x86 == 0x15) + c->cu_id = ebx & 0xff; + + if (c->x86 >= 0x17) { + c->cpu_core_id = ebx & 0xff; + + if (smp_num_siblings > 1) + c->x86_max_cores /= smp_num_siblings; + } + + /* + * We may have multiple LLCs if L3 caches exist, so check if we + * have an L3 cache by looking at the L3 cache CPUID leaf. + */ + if (cpuid_edx(0x80000006)) { + if (c->x86 == 0x17) { + /* + * LLC is at the core complex level. + * Core complex id is ApicId[3]. + */ + per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; + } else { + /* LLC is at the node level. */ + per_cpu(cpu_llc_id, cpu) = node_id; + } + } +} + /* * Fixup core topology information for * (1) AMD multi-node processors * Assumption: Number of cores in each internal node is the same. * (2) AMD processors supporting compute units */ -#ifdef CONFIG_SMP static void amd_get_topology(struct cpuinfo_x86 *c) { u8 node_id; @@ -310,39 +352,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c) /* get information required for multi-node processors */ if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { - u32 eax, ebx, ecx, edx; - - cpuid(0x8000001e, &eax, &ebx, &ecx, &edx); - - node_id = ecx & 0xff; - smp_num_siblings = ((ebx >> 8) & 0xff) + 1; - - if (c->x86 == 0x15) - c->cu_id = ebx & 0xff; - - if (c->x86 >= 0x17) { - c->cpu_core_id = ebx & 0xff; - - if (smp_num_siblings > 1) - c->x86_max_cores /= smp_num_siblings; - } - - /* - * We may have multiple LLCs if L3 caches exist, so check if we - * have an L3 cache by looking at the L3 cache CPUID leaf. - */ - if (cpuid_edx(0x80000006)) { - if (c->x86 == 0x17) { - /* - * LLC is at the core complex level. - * Core complex id is ApicId[3]. - */ - per_cpu(cpu_llc_id, cpu) = c->apicid >> 3; - } else { - /* LLC is at the node level. */ - per_cpu(cpu_llc_id, cpu) = node_id; - } - } + __get_topoext(c, cpu); } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) { u64 value; -- 2.7.4