Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4207975yba; Tue, 9 Apr 2019 13:35:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1lJqhWVVu0gR31o+Uwz6rJN5ArrZ0KMkYzcYpP9Gvqf4+A5xjQMQF5inkUGFk5Y0qVP0E X-Received: by 2002:a62:1701:: with SMTP id 1mr39350811pfx.120.1554842121451; Tue, 09 Apr 2019 13:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554842121; cv=none; d=google.com; s=arc-20160816; b=V2Voul5K88EA9bVKxfd4PXlya79wopadcwBZxCsuoCoNuHnmXYcgRyTUK3Sul34g3R ku1wdYRkjdnM+s8JvzRqnxmNBtEcM0euqTl5HyQVF5a6XY3WLrnyGtGmw1SBKu3hsl6J o/lNEWRD88KRkiwjvhkPK2y51vWhtvkGQ/DUr2v+bB34dZbo+bEh11/QnmpQLDeXOLaO 1dau/49t0j/x4dKB7wwvFpv25AjwcgsV1PcJN6pI/vtAIh5FhoILI51IfehVtT+8Uq2/ Z8V2oPxjeDS6LD7s/nxcd1dGWIdztME/Q+GC93zV2FgYWooNzHmTr5VV8W3QIDewHmxQ sbfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9pkiibSoE1UtncS1t4SALzcqhoYEOsusZM3elMz8lWU=; b=fPHCtIhKnwq/hKcK9owunEadh1GB3qH8VbBe7/lTwrSffuju9ru86vRogCZZAV4wEL emClnkrkWxpXqc34rejbrsS31elGA6zg6RjMNQOobVb3W6m14GJDPXfU4p6RMTJG3EQV jEshUwSCcf4u7ad4CrR19XLbpaT3A1Eaq+1/oXk1Ra0S0U02fTARzt8LgouLwTI231Qy ulzN679LqB8aUq8Xb2f75Hq2tFo9khYxPoMv0LoC4jqxS5vq531Rbg161QZ0dqzedv94 s2jF9/A4qMTsJxFjtvnYjQb6yxXSlbL6lyNfNl0rVxGqLhGFCpned3uURNXDm67+V0Du HW5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=FihTCBNe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si28972630plk.385.2019.04.09.13.35.02; Tue, 09 Apr 2019 13:35:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=FihTCBNe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726602AbfDIUeY (ORCPT + 99 others); Tue, 9 Apr 2019 16:34:24 -0400 Received: from mail.skyhub.de ([5.9.137.197]:51338 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbfDIUeX (ORCPT ); Tue, 9 Apr 2019 16:34:23 -0400 Received: from zn.tnic (p200300EC2F0F8500250718ACA0948A5F.dip0.t-ipconnect.de [IPv6:2003:ec:2f0f:8500:2507:18ac:a094:8a5f]) (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 9F12E1EC00FF; Tue, 9 Apr 2019 22:34:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554842061; 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=9pkiibSoE1UtncS1t4SALzcqhoYEOsusZM3elMz8lWU=; b=FihTCBNeWMvliyh2g7ngcgErRE+xcnI7X5F1Yig3UDVessMKky9GE5TwXRxMHd7IenWgru 78WrokkV1PCoyKgldcCPALeNykPMpMrvtn4K1uuLeozh4zGSnclUMn51onRl4i5WfAYFcL Li2RUJCLAaBN3gKjI/rqI+Tsiuc3jck= Date: Tue, 9 Apr 2019 22:34:12 +0200 From: Borislav Petkov To: "Ghannam, Yazen" Cc: "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "tony.luck@intel.com" , "x86@kernel.org" Subject: Re: [PATCH RESEND 2/5] x86/MCE: Handle MCA controls in a per_cpu way Message-ID: <20190409203412.GE6150@zn.tnic> References: <20190408141205.12376-1-Yazen.Ghannam@amd.com> <20190408141205.12376-3-Yazen.Ghannam@amd.com> <20190408175142.GK15689@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 08, 2019 at 06:55:59PM +0000, Ghannam, Yazen wrote: > We already have the case where some banks are not initialized either > due to quirks or because they are Read-as-Zero, but we don't try to > skip creating their files. With this full set (see patch 5), an unused > bank will return a control value of 0. So set_bank() is changed to do: @@ -2088,7 +2097,7 @@ static ssize_t set_bank(struct device *s, struct device_attribute *attr, if (kstrtou64(buf, 0, &new) < 0) return -EINVAL; - if (bank >= mca_cfg.banks) + if (bank >= per_cpu(num_banks, s->id)) return -EINVAL; How would that work if the disabled/not-present bank is in the middle? The old example: bank3 on CPU5. > Would that be sufficient to indicate that a bank is not used? Well, it should not allow for any control bits to be set and it should have the proper bank number. > But I do have a couple of thoughts: > 1) Will missing banks confuse users? As mentioned, we already have the > case of unused/uninitialized banks today, but we don't skip their file > creation. a) Will this affect any userspace tools? I guess it would be easier if we keep creating all files but denote properly which banks are disabled. > 2) Is the added complexity for file creation/destruction worth it? As > mentioned, the file will return 0 for unused/uninitialized banks. Yeah. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.