From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757033AbbE2Swl (ORCPT ); Fri, 29 May 2015 14:52:41 -0400 Received: from mail-bn1on0111.outbound.protection.outlook.com ([157.56.110.111]:43744 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756998AbbE2Swf (ORCPT ); Fri, 29 May 2015 14:52:35 -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: 0NP4KFK-07-ZV5-02 X-M-MSG: Message-ID: <5568B570.5080106@amd.com> Date: Fri, 29 May 2015 13:52:32 -0500 From: Aravind Gopalakrishnan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Borislav Petkov CC: , , , Subject: Re: [PATCH 6/6] edac, mce_amd_inj: Inject errors on NBC for bank 4 errors References: <1432753418-2985-1-git-send-email-Aravind.Gopalakrishnan@amd.com> <1432753418-2985-7-git-send-email-Aravind.Gopalakrishnan@amd.com> <20150529160039.GJ31435@pd.tnic> In-Reply-To: <20150529160039.GJ31435@pd.tnic> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC010;1:csnEwvhcIm61jq9WacjObaLptn9WAeHYOiTrlrIbj8cFYfhZIQsy5SDcpFvfch8lnGGH/qQRi+sDzcabcSnXqG7J56OpynLhAbvV5opg3WITg1Xk8V9hnBoUjXh3i1XbSah4Cb1DutgvqdVEYQrNdzDu0+0J50PlZH9R9DcY4UVcx9C7sGdfqe3+Ct03nFZg08Pu/6JoXor0Ge+yPeSOXLR8jx/g4IduOuABlmFfG67qg09swlsbjSpCzFfScBXPV+OJhuO73Skwgjsk5pzcAQ== X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(189002)(51704005)(377454003)(479174004)(24454002)(199003)(164054003)(189998001)(86362001)(4001350100001)(80316001)(110136002)(120886001)(101416001)(62966003)(5001920100001)(77156002)(59896002)(5001860100001)(65816999)(87266999)(54356999)(97736004)(50986999)(76176999)(50466002)(105586002)(5001830100001)(2950100001)(4001540100001)(92566002)(87936001)(65806001)(65956001)(23676002)(36756003)(33656002)(64126003)(68736005)(64706001)(47776003)(106466001)(46102003)(77096005)(19580395003)(83506001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR02MB243;H:atltwp01.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB243; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BLUPR02MB243;BCL:0;PCL:0;RULEID:;SRVR:BLUPR02MB243; X-Forefront-PRVS: 059185FE08 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2015 18:52:33.3936 (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: BLUPR02MB243 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/29/2015 11:00 AM, Borislav Petkov wrote: > On Wed, May 27, 2015 at 02:03:38PM -0500, Aravind Gopalakrishnan wrote: >> >> +static u32 amd_get_num_nodes(void) >> +{ >> + u32 nodes = 1; >> + >> + if (cpu_has_topoext) { >> + u32 ecx; >> + >> + ecx = cpuid_ecx(0x8000001e); >> + nodes = ((ecx >> 8) & 7) + 1; >> + } else if (static_cpu_has(X86_FEATURE_NODEID_MSR)) { >> + u64 value; >> + >> + rdmsrl(MSR_FAM10H_NODE_ID, value); >> + nodes = ((value >> 3) & 7) + 1; >> + } > So we already do that (and more) in amd_get_topology(). I'm thinking > you should take this function out of the CONFIG_X86_HT ifdeffery (also > in its caller amd_detect_cmp()) and you should save "nodes" in a local > static variable called nodes_per_processor and a small accessor called > amd_get_nodes_cnt() should return it. Similar to amd_get_nb_id(). I can remove the #ifdefs, but I'm wondering why it was there to begin with.. CONFIG_X86_HT defaults to 'Y' anyway right? And OK, will add the function in a separate pre-patch. > Don't forget to add a comment explaning what that nodes_per_processor > means. Will do. > And then amd_mce_inj.c will simply use it instead of duplicating that > information here. > > Please do that in 2 pre-patches. Will do. >> + >> + if (!(val & BIT(27))) { >> + pr_err("%s: BIOS not setting D18F3x44[NbMcaToMstCpuEn]." >> + "Doing that here\n", __func__); > WARNING: quoted string split across lines > #99: FILE: drivers/edac/mce_amd_inj.c:260: > + pr_err("%s: BIOS not setting D18F3x44[NbMcaToMstCpuEn]." > + "Doing that here\n", __func__); > > Do integrate checkpatch.pl into your workflow. It is sometimes right. Yeah, I do run checkpatch. With this, I think the line was going above 79 chars. So split it. I thought we split such error messages right? (amd64_edac and mce_amd.c for example have such instances) Thanks, -Aravind.