Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3975800ybl; Mon, 26 Aug 2019 03:35:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAOAeDVQ48ZUybh7AOmrrjYOJT0Eiu2NEeiT5rg4VzjIq9nVLLJ1RNSPz/27A41+kH+ghN X-Received: by 2002:a63:db45:: with SMTP id x5mr15654384pgi.293.1566815708792; Mon, 26 Aug 2019 03:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566815708; cv=none; d=google.com; s=arc-20160816; b=Vt8E6pJ7z4lyxCOq2NrtKgtVw0OxC7N2B60FCkbxYJFodQkTQubUsdnHdPZ/j8yGU5 s8ZcqKKk334NOXcZiJGzbJLLnIJtKnS0wG0PEPBbJetVL2cColW2s/tmzvpI9gvEJ75E UP5JFyUNUZRroOZ06jn8OCc839iSY7vSp0s2Zo5+C2sp3XVpafsKdnCj/HEa21pBUPM4 ItTpsYcjGczdamVTy5gSr3pLyO8Y0fS0wEmDWMasb3Qc6HXkPnvNqwNj6LE7xGPH+03I wrUGi5Bdx49/YTW3eZzh8hpgD/P90OxFJ5q/0NGAVViyurE1MW0L0StvK/cIqM1y0R9N lGBQ== 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=PhiC8W2Bp0/CZk1KvtGBJlF7S2eVkxQY28iWckK8/Qs=; b=ZuYztTtdmVQh7nvR2H+oU3lUi2MCH1sQUzJFwls1LWDvFlkOG5Jq/QsOdSglPrlxzC c133PTh200m8y5379yi4Kn57YXbrMGTs6SpeP2jRk8JhoqVK2hmAgehmqNy7DVi4Egzf UTW95S0lCCGZvaYUkPotrfQWNmbsWALll/oBApTv9/scD7RJcpZBPpQC1BBhVcT/D18y Q2I0eiaisjqmjLHg+LPkAUqEwXa7adVU+Fdhx0aI+cU270TL/WgvF4eJtIgIiSRWN2Ce 9TM4CZnUVJEsVlZvyHqSe/KkPFlTElQAp+QTK71L6ZRMi7Oh5g7u6MPr4kEbtpLeU9b4 3yhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=cbEzOJC2; 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 w10si63078pll.357.2019.08.26.03.34.52; Mon, 26 Aug 2019 03:35:08 -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=cbEzOJC2; 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 S1731216AbfHZKEW (ORCPT + 99 others); Mon, 26 Aug 2019 06:04:22 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57664 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfHZKEW (ORCPT ); Mon, 26 Aug 2019 06:04:22 -0400 Received: from zn.tnic (p200300EC2F0657001DC81C8A8210CD6A.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:5700:1dc8:1c8a:8210:cd6a]) (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 9B8FF1EC06E5; Mon, 26 Aug 2019 12:04:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1566813860; 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=PhiC8W2Bp0/CZk1KvtGBJlF7S2eVkxQY28iWckK8/Qs=; b=cbEzOJC2eLGvaleGPI2raXMtCwMPMsI+BM2a6DMBCnu25xI4r33+y+P1mb5pbIa1dROuid v9+YEhJAktBWXmjc3elvS40KWjnI0W9p9O1qdUvofGVKdJ1HPGh+yCqJdEr+VmkHvSafWg QFLlalbaMXjdL1uYGvSOVt+4pRa8Zjs= Date: Mon, 26 Aug 2019 12:04:16 +0200 From: Borislav Petkov To: Xiaochun Lee Cc: tony.luck@intel.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaochun Lee Subject: Re: [PATCH] x86/mce: show the status of cmci_disabled to user Message-ID: <20190826100416.GC27636@zn.tnic> References: <1566800164-6428-1-git-send-email-lixiaochun.2888@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1566800164-6428-1-git-send-email-lixiaochun.2888@163.com> 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, Aug 26, 2019 at 02:16:04PM +0800, Xiaochun Lee wrote: > From: Xiaochun Lee > > When enabled Firmware First mode in UEFI, we need to > set the cmci_disabled and ignore_ce in mca cfg > that users can check correct status from > "/sys/devices/system/machinecheck/machinecheckXXX/cmci_disabled" > > Signed-off-by: Xiaochun Lee > --- > arch/x86/kernel/cpu/mce/core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c > index 743370e..932c701 100644 > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > @@ -1909,6 +1909,8 @@ static void __mce_disable_bank(void *arg) > int bank = *((int *)arg); > __clear_bit(bank, this_cpu_ptr(mce_poll_banks)); > cmci_disable_bank(bank); > + mca_cfg.cmci_disabled = true; > + mca_cfg.ignore_ce = true; That's the global switch which gets written here for every bank. But you want to disable it per bank, not globally because the list of banks arch_apei_enable_cmcff() receives might not be all banks in the system which are in FF mode. Then, writing /sys/devices/system/machinecheck/machinecheckXXX/cmci_disabled from a different CPU and for a different bank reenables cmci again so you need to think of a better way how to address the per-bank thing and then to make it non-modifiable in FF mode so that it cannot be reenabled from sysfs again. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.