mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	tony.luck@intel.com, x86@kernel.org,
	Smita.KoralahalliChannabasappa@amd.com,
	Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH v6 1/4] x86/mce: Cleanup bank processing on init
Date: Fri, 23 Dec 2022 14:23:05 +0100	[thread overview]
Message-ID: <Y6WrucZu4fE8Mt3k@zn.tnic> (raw)
In-Reply-To: <20221206173607.1185907-2-yazen.ghannam@amd.com>

On Tue, Dec 06, 2022 at 11:36:04AM -0600, Yazen Ghannam wrote:
> -static void __mcheck_cpu_init_clear_banks(void)
> +static void __mcheck_cpu_init_prepare_banks(void)
>  {
>  	struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
> +	mce_banks_t all_banks;
> +	u64 msrval;
>  	int i;
>  
> -	for (i = 0; i < this_cpu_read(mce_num_banks); i++) {
> -		struct mce_bank *b = &mce_banks[i];
> -
> -		if (!b->init)
> -			continue;
> -		wrmsrl(mca_msr_reg(i, MCA_CTL), b->ctl);
> -		wrmsrl(mca_msr_reg(i, MCA_STATUS), 0);
> +	/*
> +	 * Log the machine checks left over from the previous reset. Log them
> +	 * only, do not start processing them. That will happen in mcheck_late_init()
> +	 * when all consumers have been registered on the notifier chain.
> +	 */
> +	if (mca_cfg.bootlog) {
> +		bitmap_fill(all_banks, MAX_NR_BANKS);
> +		machine_check_poll(MCP_UC | MCP_QUEUE_LOG, &all_banks);
>  	}

Yeah, just a nit ontop - lemme move all_banks into the if branch so that
it is closer and obvious:

---
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 5f406d135d32..a90d3eb6fcd8 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1755,7 +1755,6 @@ static void __mcheck_cpu_init_generic(void)
 static void __mcheck_cpu_init_prepare_banks(void)
 {
 	struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
-	mce_banks_t all_banks;
 	u64 msrval;
 	int i;
 
@@ -1765,6 +1764,8 @@ static void __mcheck_cpu_init_prepare_banks(void)
 	 * when all consumers have been registered on the notifier chain.
 	 */
 	if (mca_cfg.bootlog) {
+		mce_banks_t all_banks;
+
 		bitmap_fill(all_banks, MAX_NR_BANKS);
 		machine_check_poll(MCP_UC | MCP_QUEUE_LOG, &all_banks);
 	}

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2022-12-23 13:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 17:36 [PATCH v6 0/4] x86/mce: Support extended MCA_ADDR address on SMCA systems Yazen Ghannam
2022-12-06 17:36 ` [PATCH v6 1/4] x86/mce: Cleanup bank processing on init Yazen Ghannam
2022-12-23 13:23   ` Borislav Petkov [this message]
2022-12-06 17:36 ` [PATCH v6 2/4] x86/mce: Remove __mcheck_cpu_init_early() Yazen Ghannam
2022-12-28 18:53   ` Borislav Petkov
2023-01-03 20:54     ` Luck, Tony
2022-12-06 17:36 ` [PATCH v6 3/4] x86/mce: Define function to extract ErrorAddr from MCA_ADDR Yazen Ghannam
2022-12-06 17:36 ` [PATCH v6 4/4] x86/mce: Add support for Extended Physical Address MCA changes Yazen Ghannam
2022-12-29 11:13   ` [tip: ras/core] " tip-bot2 for Smita Koralahalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y6WrucZu4fE8Mt3k@zn.tnic \
    --to=bp@alien8.de \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=bp@suse.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®