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 4/7] EDAC/intel-bff: Add Diamond Rapids support
Date: Fri, 28 Aug 2026 08:29:59 -0700 [thread overview]
Message-ID: <20260828153002.10290-5-tony.luck@intel.com> (raw)
In-Reply-To: <20260828153002.10290-1-tony.luck@intel.com>
There are potentially bitfix filters associated with each machine check
bank. Only some banks may implement them.
Machine check banks have varying scope. E.g. there is a separate L2
cache for each module, each instance has its own bitfix filter.
Add information that will be used to map a <cpu,bank> pair to a unique
instance number for a bitfix filter.
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 | 45 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/drivers/edac/intel-bff.c b/drivers/edac/intel-bff.c
index 905cbe58bc53..f70c5e697dae 100644
--- a/drivers/edac/intel-bff.c
+++ b/drivers/edac/intel-bff.c
@@ -18,18 +18,55 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#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/printk.h>
#include <linux/types.h>
+#include <asm/cpu_device_id.h>
#include <asm/cpufeatures.h>
+#include <asm/intel-family.h>
#include <asm/mce.h>
#include <asm/msr.h>
#include <asm/msr-index.h>
+/* Machine check bank hardware unit types */
+enum bff_bank_type {
+ BFF_BANK_NONE = 0,
+ BFF_BANK_DCU,
+ BFF_BANK_DTLB,
+ BFF_BANK_MLC,
+ BFF_BANK_CCF,
+ BFF_BANK_HSF,
+ BFF_BANK_IOCACHE,
+};
+
+/*
+ * Mapping from machine check bank numbers on Diamond Rapids CPU, that are
+ * supported by a bitfix filter, to hardware unit type.
+ */
+static const enum bff_bank_type dmr_mcbanks[MAX_NR_BANKS] = {
+ [1] = BFF_BANK_DCU,
+ [2] = BFF_BANK_DTLB,
+ [3] = BFF_BANK_MLC,
+ [6] = BFF_BANK_CCF,
+ [13] = BFF_BANK_HSF,
+ [17] = BFF_BANK_IOCACHE
+};
+
+static const struct x86_cpu_id bff_cpu_ids[] __initconst = {
+ X86_MATCH_VFM(INTEL_DIAMONDRAPIDS_X, dmr_mcbanks),
+ {}
+};
+MODULE_DEVICE_TABLE(x86cpu, bff_cpu_ids);
+
+static const enum bff_bank_type *bff_bank_types;
+
static int __init bff_init(void)
{
+ const struct x86_cpu_id *m;
u64 core_caps, mcg_cap;
if (!cpu_feature_enabled(X86_FEATURE_MCA))
@@ -44,6 +81,14 @@ static int __init bff_init(void)
if (!(core_caps & MSR_IA32_CORE_CAPS_BFF_RESET))
return -ENODEV;
+ m = x86_match_cpu(bff_cpu_ids);
+ if (!m) {
+ pr_info("CPU model not supported by the bitfix filter reset driver\n");
+ return -ENODEV;
+ }
+
+ bff_bank_types = (const enum bff_bank_type *)m->driver_data;
+
return 0;
}
--
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 ` Tony Luck [this message]
2026-08-28 15:30 ` [PATCH v2 5/7] EDAC/intel-bff: Reset bitfix filter when it overflows Tony Luck
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-5-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®