From: Tony Luck <tony.luck@intel.com>
To: Tony Luck <tony.luck@intel.com>
Cc: "Borislav Petkov" <bp@alien8.de>,
"Qiuxu Zhuo" <qiuxu.zhuo@intel.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Breno Leitao" <leitao@debian.org>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev
Subject: [PATCH v2 5/7] EDAC/intel-bff: Reset bitfix filter when it overflows
Date: Fri, 28 Aug 2026 08:30:00 -0700 [thread overview]
Message-ID: <20260828153002.10290-6-tony.luck@intel.com> (raw)
In-Reply-To: <20260828153002.10290-1-tony.luck@intel.com>
Get notifications for all errors logged in machine check banks. Skip any
that do not indicate a bitfix filter overflow.
Machine check banks are scoped to a hardware unit, so the reset has to be
issued from a CPU within that unit. Use the CPU that reported the error.
Co-developed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
drivers/edac/intel-bff.c | 48 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/drivers/edac/intel-bff.c b/drivers/edac/intel-bff.c
index f70c5e697dae..c46d5255f34b 100644
--- a/drivers/edac/intel-bff.c
+++ b/drivers/edac/intel-bff.c
@@ -17,11 +17,14 @@
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/bitfield.h>
+#include <linux/bits.h>
#include <linux/cpufeature.h>
#include <linux/device-id/x86_cpu.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
+#include <linux/notifier.h>
#include <linux/printk.h>
#include <linux/types.h>
@@ -32,6 +35,11 @@
#include <asm/msr.h>
#include <asm/msr-index.h>
+/* Intel bitfix filter control register defines */
+#define MSR_MC0_BFF_CTL 0x000006c0
+#define MSR_MCx_BFF_CTL(x) (MSR_MC0_BFF_CTL + (x))
+#define MCI_BFF_RESET BIT_ULL(0)
+
/* Machine check bank hardware unit types */
enum bff_bank_type {
BFF_BANK_NONE = 0,
@@ -64,6 +72,38 @@ MODULE_DEVICE_TABLE(x86cpu, bff_cpu_ids);
static const enum bff_bank_type *bff_bank_types;
+static void bff_reset_and_report(struct mce *mce)
+{
+ /* Reset bitfix filter using the CPU that logged the yellow status */
+ if (wrmsrq_on_cpu(mce->extcpu, MSR_MCx_BFF_CTL(mce->bank), MCI_BFF_RESET))
+ pr_warn("Failed to reset bitfix filter for CPU %d Bank %d\n",
+ mce->extcpu, mce->bank);
+}
+
+static int bff_mce_notify(struct notifier_block *nb, unsigned long val, void *data)
+{
+ struct mce *mce = data;
+
+ /* TES is undefined for uncorrected errors. */
+ if (mce->status & MCI_STATUS_UC)
+ return NOTIFY_DONE;
+
+ if (MCI_STATUS_TES(mce->status) != MCI_STATUS_TES_YELLOW)
+ return NOTIFY_DONE;
+
+ if (mce->bank >= MAX_NR_BANKS || bff_bank_types[mce->bank] == BFF_BANK_NONE)
+ return NOTIFY_DONE;
+
+ bff_reset_and_report(mce);
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block bff_notifier = {
+ .notifier_call = bff_mce_notify,
+ .priority = MCE_PRIO_EDAC,
+};
+
static int __init bff_init(void)
{
const struct x86_cpu_id *m;
@@ -89,10 +129,18 @@ static int __init bff_init(void)
bff_bank_types = (const enum bff_bank_type *)m->driver_data;
+ mce_register_decode_chain(&bff_notifier);
+
return 0;
}
+static void __exit bff_exit(void)
+{
+ mce_unregister_decode_chain(&bff_notifier);
+}
+
module_init(bff_init);
+module_exit(bff_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Tony Luck");
--
2.55.0
next prev parent reply other threads:[~2026-08-28 15:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 15:29 [PATCH v2 0/7] EDAC/intel-bff: Driver to reset bitfix filters Tony Luck
2026-08-28 15:29 ` [PATCH v2 1/7] cacheinfo: Export get_cpu_cacheinfo_id() for loadable modules Tony Luck
2026-08-28 15:29 ` [PATCH v2 2/7] x86/mce: Add enumeration for Intel bitfix filter reset Tony Luck
2026-08-28 15:29 ` [PATCH v2 3/7] EDAC/intel-bff: Add stub Intel bitfix filter driver Tony Luck
2026-08-28 15:29 ` [PATCH v2 4/7] EDAC/intel-bff: Add Diamond Rapids support Tony Luck
2026-08-28 15:30 ` Tony Luck [this message]
2026-08-28 15:30 ` [PATCH v2 6/7] EDAC/intel-bff: Compute unique ID for overflowed filter Tony Luck
2026-08-28 15:30 ` [PATCH v2 7/7] EDAC/intel-bff: Report frequent filter overflows Tony Luck
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=20260828153002.10290-6-tony.luck@intel.com \
--to=tony.luck@intel.com \
--cc=bp@alien8.de \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=leitao@debian.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=qiuxu.zhuo@intel.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®