Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] x86/mce: show the status of cmci_disabled to user
@ 2019-08-26  6:16 Xiaochun Lee
  2019-08-26 10:04 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaochun Lee @ 2019-08-26  6:16 UTC (permalink / raw)
  To: tony.luck, bp
  Cc: tglx, mingo, hpa, x86, linux-edac, linux-kernel, Xiaochun Lee

From: Xiaochun Lee <lixc17@lenovo.com>

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 <lixc17@lenovo.com>
---
 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;
 }
 
 void mce_disable_bank(int bank)
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/mce: show the status of cmci_disabled to user
  2019-08-26  6:16 [PATCH] x86/mce: show the status of cmci_disabled to user Xiaochun Lee
@ 2019-08-26 10:04 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2019-08-26 10:04 UTC (permalink / raw)
  To: Xiaochun Lee
  Cc: tony.luck, tglx, mingo, hpa, x86, linux-edac, linux-kernel, Xiaochun Lee

On Mon, Aug 26, 2019 at 02:16:04PM +0800, Xiaochun Lee wrote:
> From: Xiaochun Lee <lixc17@lenovo.com>
> 
> 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 <lixc17@lenovo.com>
> ---
>  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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  6:16 [PATCH] x86/mce: show the status of cmci_disabled to user Xiaochun Lee
2019-08-26 10:04 ` Borislav Petkov

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org linux-edac@archiver.kernel.org
	public-inbox-index linux-edac


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/ public-inbox