The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Tony Luck <tony.luck@intel.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Borislav Petkov" <bp@alien8.de>,
	"Breno Leitao" <leitao@debian.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@lists.linux.dev,
	"Qiuxu Zhuo" <qiuxu.zhuo@intel.com>
Subject: Re: [PATCH 4/7] platform/x86/intel/bff: Add Diamond Rapids support
Date: Wed, 26 Aug 2026 11:17:31 +0300 (EEST)	[thread overview]
Message-ID: <1dd80e86-aba7-0cf9-c2ca-5f72c9f0dcf3@linux.intel.com> (raw)
In-Reply-To: <20260825181526.13203-5-tony.luck@intel.com>

On Tue, 25 Aug 2026, Tony Luck wrote:

> 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/platform/x86/intel/bff.c | 41 ++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/drivers/platform/x86/intel/bff.c b/drivers/platform/x86/intel/bff.c
> index 9522bdb1401d..6360bbc92347 100644
> --- a/drivers/platform/x86/intel/bff.c
> +++ b/drivers/platform/x86/intel/bff.c
> @@ -18,18 +18,51 @@
>  #define pr_fmt(fmt) "bff: " 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 scope types */
> +enum bff_type {
> +	BFF_NONE = 0,
> +	BFF_BANK_DCU,
> +	BFF_BANK_DTLB,
> +	BFF_BANK_MLC,
> +	BFF_BANK_CCF,
> +	BFF_BANK_HSF,
> +	BFF_BANK_IOCACHE,
> +};
> +
> +static const enum bff_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

Please add trailing comma.

> +};
> +
> +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_type *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))
> @@ -45,6 +78,14 @@ static int __init bff_init(void)
>  	if (!(core_caps & MSR_IA32_CORE_CAPS_BFF_RESET_DETECT))
>  		return -ENODEV;
>  
> +	m = x86_match_cpu(bff_cpu_ids);
> +	if (!m) {
> +		pr_info("CPU supports bitfix filter, but driver does not\n");
> +		return -ENODEV;
> +	}
> +
> +	bank_types = (const enum bff_type *)m->driver_data;
> +
>  	return 0;
>  }
>  
> 

-- 
 i.


  reply	other threads:[~2026-08-26  8:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 18:15 [PATCH 0/7] Intel platform driver to reset bitfix filters Tony Luck
2026-08-25 18:15 ` [PATCH 1/7] cacheinfo: Export get_cpu_cacheinfo_id() for loadable modules Tony Luck
2026-08-25 18:15 ` [PATCH 2/7] x86/mce: Enumeration updates for Intel bitfix filter reset Tony Luck
2026-08-26  8:15   ` Ilpo Järvinen
2026-08-25 18:15 ` [PATCH 3/7] platform/x86/intel/bff: Add stub Intel bitfix filter driver Tony Luck
2026-08-25 18:15 ` [PATCH 4/7] platform/x86/intel/bff: Add Diamond Rapids support Tony Luck
2026-08-26  8:17   ` Ilpo Järvinen [this message]
2026-08-25 18:15 ` [PATCH 5/7] platform/x86/intel/bff: Reset bitfix filter when it overflows Tony Luck
2026-08-25 18:15 ` [PATCH 6/7] platform/x86/intel/bff: Compute unique ID for overflowed filter Tony Luck
2026-08-26  8:26   ` Ilpo Järvinen
2026-08-25 18:15 ` [PATCH 7/7] platform/x86/intel/bff: Report frequent filter resets Tony Luck
2026-08-26  8:39   ` Ilpo Järvinen
2026-08-25 18:28 ` [PATCH 0/7] Intel platform driver to reset bitfix filters Borislav Petkov
2026-08-25 18:55   ` Luck, Tony
2026-08-25 19:23     ` Borislav Petkov

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=1dd80e86-aba7-0cf9-c2ca-5f72c9f0dcf3@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=hansg@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=qiuxu.zhuo@intel.com \
    --cc=tony.luck@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