Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5132626yba; Wed, 10 Apr 2019 12:04:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZXmfYL9nzMpW3dk+dswcHtXA4vjfhNGqmlNI+38SmTk9zS9ZQzkyzVxO60OLL/jvqTYgv X-Received: by 2002:a17:902:b686:: with SMTP id c6mr45810021pls.14.1554923093853; Wed, 10 Apr 2019 12:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554923093; cv=none; d=google.com; s=arc-20160816; b=DAUNKzvinUIrFCcN8xTsrycBD3qg5lIW5QO34jkxROvj+GN1RuDWhEqLV9TTc2xh7x HNhdoa5jaNBKjZhEe6aEO2U2pkQJAJ8VGgWrq48pzEFp6FtJQO2hFIJqykpd8DZbv5R2 JbEIw9Z3H0MfM8Et7yjQLTDaH3CDQ9fQtFeYuwR0ztW2qCyiAYFAnboTEY0K/SwSq98Q lHpLFP6wUUy7tsf6iIiECeX+R0VoFNLu6P/D5hGbKzp1+T+W2mMLELT/VRFkl7tPkoEY XdrKBB9MkmARbTw6Omc/E/+mZ6PdJVB28bW1ZLAnR8JwQiV7zODiQM4mA/SbhimPGJIj qXKg== 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=XcAeVmm3JHcWiuNHD4dSqbLHlPuiBy3ozgXMYTg4/oM=; b=0Pe5UGmrYYskh2Ea7AA+JjpdY69lLSE2K3xNTadLFMc4VkANQsYCe/hIAyIDmofe9r 17MJ1NiA50vjK8cykO3G8b3DA62/r/S1cSajPnJ6IsiqDoX3Pft7N0m3+qR96b6Ly6Wo hpKvZEUf0ZEmidiwaBNZRGL1t5Ut4R4422jrYXC9lO5trS7Oxv4h+u8LKWbnYR3qbD3U y057cBqY2wfxRWFrTK4/HixpTT3OHbYjfaqjdnIpk+2YbQC0+4fxpz9+yGNBqAr3Rdnx Jg/BzBAb4NPN/hQViB2qTkHKskfTmGfEKS7czNS8RkqX5HYxLI4e1d16k38+We/ImhXU E15A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="Yx/D6BVn"; 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 v9si3577539pgs.17.2019.04.10.12.04.37; Wed, 10 Apr 2019 12:04:53 -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="Yx/D6BVn"; 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 S1729171AbfDJRZr (ORCPT + 99 others); Wed, 10 Apr 2019 13:25:47 -0400 Received: from mail.skyhub.de ([5.9.137.197]:41230 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729030AbfDJRZr (ORCPT ); Wed, 10 Apr 2019 13:25:47 -0400 Received: from zn.tnic (p200300EC2F0CAE00295B1FE58D6681B0.dip0.t-ipconnect.de [IPv6:2003:ec:2f0c:ae00:295b:1fe5:8d66:81b0]) (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 588461EC0104; Wed, 10 Apr 2019 19:25:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554917145; 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=XcAeVmm3JHcWiuNHD4dSqbLHlPuiBy3ozgXMYTg4/oM=; b=Yx/D6BVnXY/KZiFicss72wboe1le6SCIZjYeeJZGLqzdvq0/STVREFCpbCG3SLM6SfZrIT 76N3kNkmsAB7At6D0edukNGmZ8QM4HsEIlEcDxRrpsyh2vzk9+FpR5jc+vBR4rhcA2dhQP MrQZgP6mGNWiSHZCnDKzHrjglA6cRjc= Date: Wed, 10 Apr 2019 19:25:39 +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: <20190410172539.GF26580@zn.tnic> References: <20190408141205.12376-1-Yazen.Ghannam@amd.com> <20190408141205.12376-3-Yazen.Ghannam@amd.com> <20190408175142.GK15689@zn.tnic> <20190409203412.GE6150@zn.tnic> <20190410164036.GC26580@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 Wed, Apr 10, 2019 at 04:58:12PM +0000, Ghannam, Yazen wrote: > Yes, unused banks in the middle are counted in the MCG_CAP[Count] value. Good. > Okay, so you're saying the sysfs access should fail if a bank is > disabled. Is that correct? Well, think about it. If a bank is not operational for whatever reason, we should tell the user that. > Does "disabled" mean one or both of these? > Unused = RAZ/WI in hardware > Uninitialized = Not initialized by kernel due to quirks, etc. > > For an unused bank, it doesn't hurt to write MCA_CTL, but really > there's no reason to do so and go through mce_restart(). Yes, but that bank is non-operational in some form. So we should prevent all writes to it because, well, it is not going to do anything. And this would be a good way to give feedback to the user that that is the case. > For an uninitialized bank, should we prevent users from overriding the > kernel's settings? That all depends on the quirks. Whether we should allow them to be overridden or not. I don't think we've ever thought about it, though. Let's look at one: if (c->x86_vendor == X86_VENDOR_AMD) { if (c->x86 == 15 && cfg->banks > 4) { /* * disable GART TBL walk error reporting, which * trips off incorrectly with the IOMMU & 3ware * & Cerberus: */ clear_bit(10, (unsigned long *)&mce_banks[4].ctl); Yah, so if the user reenables those GART errors, then she/he will see a lot of MCEs reported and will maybe complain about it. And then we'll say, but why did you enable them then. And she/he'll say: uh, didn't know. Or, I was just poking at sysfs and this happened. Then we can say, well, don't do that then! :-) So my current position is, meh, who cares. But then I'm looking at another quirk: if (c->x86_vendor == X86_VENDOR_INTEL) { /* * SDM documents that on family 6 bank 0 should not be written * because it aliases to another special BIOS controlled * register. * But it's not aliased anymore on model 0x1a+ * Don't ignore bank 0 completely because there could be a * valid event later, merely don't write CTL0. */ if (c->x86 == 6 && c->x86_model < 0x1A && cfg->banks > 0) mce_banks[0].init = 0; which basically prevents that bank from being reinitialized. So I guess we have that functionality already - we simply need to pay attention to w->init. Right? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.