From: Yazen Ghannam <yazen.ghannam@amd.com>
To: "Eirik Bøe" <contact@optocloud.no>
Cc: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Avadhut Naik <avadhut.naik@amd.com>,
Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] x86/mce: Reset stale per-bank state between bank scans
Date: Thu, 15 Oct 2026 11:13:48 -0400 [thread overview]
Message-ID: <20261015151348.GA5279@yaz-khff2.amd.com> (raw)
In-Reply-To: <kUFp15ffSyDl005h7gLuz1YQ_jDrCgR96A_Q5mxzpXl2BmMNfFHo8hivkv7Qx6NZ6M__9iM0s2nFwDnjcBO_wcJ9-jHHIp8IrgfylJ0av6k=@optocloud.no>
On Wed, Oct 14, 2026 at 01:01:39PM +0000, Eirik Bøe wrote:
> From: Eirik Bøe <git@optocloud.no>
>
> machine_check_poll() and __mc_scan_banks() reuse a single
> struct mce_hw_err across the whole bank scan. The record is zeroed
> once before the loop; each iteration then resets only MISC and ADDR.
> Four more fields are written conditionally inside the loop and never
> cleared again, so a later bank inherits them.
>
> On SMCA, mce_read_aux() writes SYND and synd1/synd2 only when
> MCI_STATUS_SYNDV is set, so a bank without SYNDV is printed with the
> syndromes of an earlier bank in the same scan. Decoders are expected
> to ignore them when SYNDV is clear, so the stale values are cosmetic.
>
> A stale m->kflags has two effects on a later bank:
>
> - smca_should_log_poll_error() sets MCE_CHECK_DFR_REGS when an
> error was taken from MCA_DESTAT. A later bank with ADDRV then
> reads MCx_DEADDR instead of MCA_ADDR, and amd_clear_bank()
> returns before clearing MCA_STATUS, so that bank is logged a
> second time.
>
> - mce_default_notifier() prints only when m->kflags is empty, so
> unless print_all is set, a bank that inherits the bit is not
> printed by the notifier chain.
>
> Factor the per-bank clearing into mce_clear_hw_err_fields() and call
> it from both loops. Reset the vendor union as a whole so later
> additions are covered.
>
> Found by code inspection; not reproduced on hardware.
>
> Fixes: db819d60f672 ("x86/mce: Add support for new MCA_SYND register")
> Fixes: d4fca1358ea9 ("x86/MCE/AMD: Add support for new MCA_SYND{1,2} registers")
> Fixes: 7cb735d7c0cb ("x86/mce: Unify AMD DFR handler with MCA Polling")
> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Signed-off-by: Eirik Bøe <git@optocloud.no>
> ---
>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Thanks,
Yazen
prev parent reply other threads:[~2026-10-15 15:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 13:01 [PATCH v4] x86/mce: Reset stale per-bank state between bank scans Eirik Bøe
2026-10-14 15:43 ` Luck, Tony
2026-10-15 15:13 ` Yazen Ghannam [this message]
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=20261015151348.GA5279@yaz-khff2.amd.com \
--to=yazen.ghannam@amd.com \
--cc=avadhut.naik@amd.com \
--cc=bp@alien8.de \
--cc=contact@optocloud.no \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=qiuxu.zhuo@intel.com \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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