[PATCH 3/7] platform/x86/intel/bff: Add stub Intel bitfix filter driver
From: Tony Luck
Date: Tue Aug 25 2026 - 14:16:32 EST
Check if platform supports enhanced cache error reporting and the
bitfix filter reset feature.
Co-developed-by: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@xxxxxxxxx>
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
drivers/platform/x86/intel/bff.c | 59 +++++++++++++++++++++++++++++
drivers/platform/x86/intel/Kconfig | 13 +++++++
drivers/platform/x86/intel/Makefile | 1 +
3 files changed, 73 insertions(+)
create mode 100644 drivers/platform/x86/intel/bff.c
diff --git a/drivers/platform/x86/intel/bff.c b/drivers/platform/x86/intel/bff.c
new file mode 100644
index 000000000000..9522bdb1401d
--- /dev/null
+++ b/drivers/platform/x86/intel/bff.c
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright(c) 2026 Intel Corporation. */
+
+/*
+ * Intel driver to reset bitfix filters when they overflow.
+ *
+ * Each bitfix filter has limited slots to track corrected errors.
+ * These slots can be filled by transient corrected errors (e.g.,
+ * bit flips from particle strikes) that don't represent permanent
+ * hardware defects.
+ *
+ * When the filter overflows (yellow status), reset it to reclaim
+ * slots occupied by transient corrected errors. If the overflow
+ * repeats frequently after reset, it indicates persistent hardware
+ * defects that need attention: the system should be scheduled for
+ * servicing.
+ */
+#define pr_fmt(fmt) "bff: " fmt
+
+#include <linux/cpufeature.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+
+#include <asm/cpufeatures.h>
+#include <asm/mce.h>
+#include <asm/msr.h>
+#include <asm/msr-index.h>
+
+static int __init bff_init(void)
+{
+ u64 core_caps, mcg_cap;
+
+ if (!cpu_feature_enabled(X86_FEATURE_MCA))
+ return -ENODEV;
+ rdmsrq(MSR_IA32_MCG_CAP, mcg_cap);
+ if (!(mcg_cap & MCG_TES_P))
+ return -ENODEV;
+
+ if (!cpu_feature_enabled(X86_FEATURE_CORE_CAPABILITIES))
+ return -ENODEV;
+
+ rdmsrq(MSR_IA32_CORE_CAPS, core_caps);
+ if (!(core_caps & MSR_IA32_CORE_CAPS_BFF_RESET_DETECT))
+ return -ENODEV;
+
+ return 0;
+}
+
+static void __exit bff_exit(void)
+{
+}
+
+module_init(bff_init);
+module_exit(bff_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Intel bitfix filter reset driver");
diff --git a/drivers/platform/x86/intel/Kconfig b/drivers/platform/x86/intel/Kconfig
index 2900407d6095..f4e9af0116ee 100644
--- a/drivers/platform/x86/intel/Kconfig
+++ b/drivers/platform/x86/intel/Kconfig
@@ -251,3 +251,16 @@ config INTEL_VSEC
To compile this driver as a module, choose M here: the module will
be called intel_vsec.
+
+config INTEL_BFF_RESET
+ tristate "Intel bitfix filter reset driver"
+ depends on CPU_SUP_INTEL && X86_MCE
+ help
+ Adds support for Intel systems that implement bitfix filters to
+ suppress repeated logging and signaling of the same corrected
+ error. Those filters can become clogged with transient errors
+ over time. Clearing the filter may make space for additional
+ hard errors.
+
+ To compile this driver as a module, choose M here: the module will
+ be called intel_bff.
diff --git a/drivers/platform/x86/intel/Makefile b/drivers/platform/x86/intel/Makefile
index 138b13756158..dc4e374758d5 100644
--- a/drivers/platform/x86/intel/Makefile
+++ b/drivers/platform/x86/intel/Makefile
@@ -27,6 +27,7 @@ intel-target-$(CONFIG_INTEL_ISHTP_ECLITE) += ishtp_eclite.o
intel-target-$(CONFIG_INTEL_OAKTRAIL) += oaktrail.o
intel-target-$(CONFIG_INTEL_SDSI) += sdsi.o
intel-target-$(CONFIG_INTEL_VSEC) += vsec.o
+intel-target-$(CONFIG_INTEL_BFF_RESET) += bff.o
# Intel PMIC / PMC / P-Unit drivers
intel-target-$(CONFIG_INTEL_BYTCRC_PWRSRC) += bytcrc_pwrsrc.o
--
2.55.0