From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [RESEND,4/5] x86/MCE: Make number of MCA banks per_cpu From: Borislav Petkov Message-Id: <20190408205013.GN15689@zn.tnic> Date: Mon, 8 Apr 2019 22:50:13 +0200 To: "Luck, Tony" Cc: "Ghannam, Yazen" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" List-ID: T24gTW9uLCBBcHIgMDgsIDIwMTkgYXQgMDg6NDI6MzZQTSArMDAwMCwgTHVjaywgVG9ueSB3cm90 ZToKPiA+IEFjdHVhbGx5LCBpdCBzaG91bGQgbm90IGJlIGV4cG9ydGVkIGF0IGFsbC4gQSBmdW5j dGlvbiByZXR1cm5pbmcgdGhlIG51bQo+ID4gYmFua3MgaXMgYmV0dGVyIGluc3RlYWQuCj4gCj4g QXJlIGFsbCB0aGUgcGxhY2VzIGl0IGlzIHVzZWQgaW4gbm9uLXByZS1lbXB0aWJsZSBzZWN0aW9u cyBvZiBjb2RlPyBMb29waW5nCj4gaW4gdGhlIENNQ0kgYW5kICNNQyBoYW5kbGVycyBzaG91bGQg YmUgZmluZS4gQnV0IGRvIHdlIG5lZWQgZ2V0X2NwdSgpL3B1dF9jcHUoKQo+IGluIGFueSBwbGFj ZXM/CgpUaGF0IGV4cG9ydCBpcyBuZWVkZWQgb25seSBpbiB0aGUgbWNlIGluamVjdG9yLiBBY3R1 YWxseSwgaXQgd291bGQgYmUKbXVjaCBjbGVhbmVyIGlmIHRoZSBpbmplY3RvciB3b3VsZCBmaW5k IG91dCB0aGUgY291bnQgc3RyYWlnaHQgZnJvbSB0aGUKTVNSIGFzIGl0IGRvZXMgbm93LCBidXQg YmUgY2hhbmdlZCB0byBkbyByZG1zcl9vbl9jcHUoKSBub3csIHNpbmNlIGNhbgpoYXZlIGRpZmZl cmVudCBudW1fYmFua3Mgb24gYSBDUFUuCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1358C10F13 for ; Mon, 8 Apr 2019 20:50:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 618B820880 for ; Mon, 8 Apr 2019 20:50:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="GKbsnM9R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728623AbfDHUu2 (ORCPT ); Mon, 8 Apr 2019 16:50:28 -0400 Received: from mail.skyhub.de ([5.9.137.197]:42054 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726240AbfDHUu2 (ORCPT ); Mon, 8 Apr 2019 16:50:28 -0400 Received: from zn.tnic (p200300EC2F07270055F9EC31A4C987AB.dip0.t-ipconnect.de [IPv6:2003:ec:2f07:2700:55f9:ec31:a4c9:87ab]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B34BB1EC058A; Mon, 8 Apr 2019 22:50:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554756626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=W9F3mZ3I7PPAMth6rxuWjcq7V2LJMrFHmRGb+axTv8w=; b=GKbsnM9RtPkjpz9V+jFITpBOmSaOf9d4kUVKUvliU0kCs5MLW4ji2dXy9yJrAVYMJgzQYS 6khYyMwciebiMTh/XbzjHSjabYD94nAhPJGzO6yrSlpEuYkY2UZApGX3Okx6gmjtsCx/ha /oVWApyc6wOQWjND5+4Eeot2q8ymFec= Date: Mon, 8 Apr 2019 22:50:13 +0200 From: Borislav Petkov To: "Luck, Tony" Cc: "Ghannam, Yazen" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH RESEND 4/5] x86/MCE: Make number of MCA banks per_cpu Message-ID: <20190408205013.GN15689@zn.tnic> References: <20190408141205.12376-1-Yazen.Ghannam@amd.com> <20190408141205.12376-5-Yazen.Ghannam@amd.com> <20190408202659.GA5232@agluck-desk> <20190408203431.GM15689@zn.tnic> <3908561D78D1C84285E8C5FCA982C28F7E8F6A61@ORSMSX104.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F7E8F6A61@ORSMSX104.amr.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org Message-ID: <20190408205013.bJn6aZhmZL4cLaNiWViceiVKsKwXcsJPDCN4hZydVEQ@z> On Mon, Apr 08, 2019 at 08:42:36PM +0000, Luck, Tony wrote: > > Actually, it should not be exported at all. A function returning the num > > banks is better instead. > > Are all the places it is used in non-pre-emptible sections of code? Looping > in the CMCI and #MC handlers should be fine. But do we need get_cpu()/put_cpu() > in any places? That export is needed only in the mce injector. Actually, it would be much cleaner if the injector would find out the count straight from the MSR as it does now, but be changed to do rdmsr_on_cpu() now, since can have different num_banks on a CPU. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.