[PATCH v4 05/31] fs/resctrl: Set up Kconfig options for telemetry events

Tony Luck posted 31 patches 7 months, 3 weeks ago
There is a newer version of this series
[PATCH v4 05/31] fs/resctrl: Set up Kconfig options for telemetry events
Posted by Tony Luck 7 months, 3 weeks ago
Intel RMID based telemetry events are counted by each CPU core
and then aggregated by one or more per-socket micro controllers.
Enumeration support is provided by the Intel PMT subsystem.

N.B. Patches for the Intel PMT system are still in progress.
They will define an INTEL_PMT_DISCOVERY Kconfig symbol that
will be one of the dependencies. This is commented out for
now. Final version will include this dependency.

arch/x86 selects this option based on:

X86_64: Counter registers are in MMIO space. There is no readq()
function on 32-bit. Emulation is possible with readl(), but there
are races. Running 32-bit kernels on systems that support this
feature seems pointless.

CPU_SUP_INTEL: It is an Intel specific feature.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/Kconfig                       | 1 +
 drivers/platform/x86/intel/pmt/Kconfig | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5a09acf41c8e..19107fdb4264 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -508,6 +508,7 @@ config X86_CPU_RESCTRL
 	bool "x86 CPU resource control support"
 	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
 	depends on MISC_FILESYSTEMS
+	select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL)
 	select ARCH_HAS_CPU_RESCTRL
 	select RESCTRL_FS
 	select RESCTRL_FS_PSEUDO_LOCK
diff --git a/drivers/platform/x86/intel/pmt/Kconfig b/drivers/platform/x86/intel/pmt/Kconfig
index e916fc966221..3a8ce39d1004 100644
--- a/drivers/platform/x86/intel/pmt/Kconfig
+++ b/drivers/platform/x86/intel/pmt/Kconfig
@@ -38,3 +38,10 @@ config INTEL_PMT_CRASHLOG
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called intel_pmt_crashlog.
+
+config INTEL_AET_RESCTRL
+	depends on INTEL_PMT_TELEMETRY # && INTEL_PMT_DISCOVERY
+	bool
+	help
+	  Architecture config should "select" this option to enable
+	  support for RMID telemetry events in the resctrl file system.
-- 
2.48.1
Re: [PATCH v4 05/31] fs/resctrl: Set up Kconfig options for telemetry events
Posted by Chen, Yu C 7 months, 1 week ago
Hi Tony,

On 4/29/2025 8:33 AM, Tony Luck wrote:
> Intel RMID based telemetry events are counted by each CPU core
> and then aggregated by one or more per-socket micro controllers.
> Enumeration support is provided by the Intel PMT subsystem.
> 
> N.B. Patches for the Intel PMT system are still in progress.
> They will define an INTEL_PMT_DISCOVERY Kconfig symbol that
> will be one of the dependencies. This is commented out for
> now. Final version will include this dependency.
> 
> arch/x86 selects this option based on:
> 
> X86_64: Counter registers are in MMIO space. There is no readq()
> function on 32-bit. Emulation is possible with readl(), but there
> are races. Running 32-bit kernels on systems that support this
> feature seems pointless.
> 
> CPU_SUP_INTEL: It is an Intel specific feature.
> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>   arch/x86/Kconfig                       | 1 +
>   drivers/platform/x86/intel/pmt/Kconfig | 7 +++++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5a09acf41c8e..19107fdb4264 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -508,6 +508,7 @@ config X86_CPU_RESCTRL
>   	bool "x86 CPU resource control support"
>   	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
>   	depends on MISC_FILESYSTEMS
> +	select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL)

Not sure if if it is expected, I got the following warning
during compiling:
WARNING: unmet direct dependencies detected for INTEL_AET_RESCTRL
   Depends on [n]: X86_PLATFORM_DEVICES [=y] && INTEL_PMT_TELEMETRY [=n]
   Selected by [y]:
   - X86_CPU_RESCTRL [=y] && X86 [=y] && (CPU_SUP_INTEL [=y] || 
CPU_SUP_AMD [=y]) && MISC_FILESYSTEMS [=y] && X86_64 [=y] && 
CPU_SUP_INTEL [=y]

I think this is because the INTEL_PMT_TELEMETRY is disabled.
Does it make sense to add the dependency of INTEL_PMT_TELEMETRY
to auto-select for INTEL_AET_RESCTRL?

select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL && INTEL_PMT_TELEMETRY)

thanks,
Chenyu

>   	select ARCH_HAS_CPU_RESCTRL
>   	select RESCTRL_FS
>   	select RESCTRL_FS_PSEUDO_LOCK
> diff --git a/drivers/platform/x86/intel/pmt/Kconfig b/drivers/platform/x86/intel/pmt/Kconfig
> index e916fc966221..3a8ce39d1004 100644
> --- a/drivers/platform/x86/intel/pmt/Kconfig
> +++ b/drivers/platform/x86/intel/pmt/Kconfig
> @@ -38,3 +38,10 @@ config INTEL_PMT_CRASHLOG
>   
>   	  To compile this driver as a module, choose M here: the module
>   	  will be called intel_pmt_crashlog.
> +
> +config INTEL_AET_RESCTRL
> +	depends on INTEL_PMT_TELEMETRY # && INTEL_PMT_DISCOVERY
> +	bool
> +	help
> +	  Architecture config should "select" this option to enable
> +	  support for RMID telemetry events in the resctrl file system.
RE: [PATCH v4 05/31] fs/resctrl: Set up Kconfig options for telemetry events
Posted by Luck, Tony 7 months, 1 week ago
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index 5a09acf41c8e..19107fdb4264 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -508,6 +508,7 @@ config X86_CPU_RESCTRL
> >     bool "x86 CPU resource control support"
> >     depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
> >     depends on MISC_FILESYSTEMS
> > +   select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL)
>
> Not sure if if it is expected, I got the following warning
> during compiling:
> WARNING: unmet direct dependencies detected for INTEL_AET_RESCTRL
>    Depends on [n]: X86_PLATFORM_DEVICES [=y] && INTEL_PMT_TELEMETRY [=n]
>    Selected by [y]:
>    - X86_CPU_RESCTRL [=y] && X86 [=y] && (CPU_SUP_INTEL [=y] ||
> CPU_SUP_AMD [=y]) && MISC_FILESYSTEMS [=y] && X86_64 [=y] &&
> CPU_SUP_INTEL [=y]
>
> I think this is because the INTEL_PMT_TELEMETRY is disabled.
> Does it make sense to add the dependency of INTEL_PMT_TELEMETRY
> to auto-select for INTEL_AET_RESCTRL?
>
> select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL && INTEL_PMT_TELEMETRY)

I'll try to get some proper solution once the OOBMSM driver updates are
upstream and I don't need to provide fake interfaces. Latest version of
those patches are here[1].

Those patches add the "PMT discovery driver" which is the part that provides
the intel_pmt_get_regions_by_feature() interface. Resctrl will need to depend
on (or select) INTEP_PMT_DISCOVERY=y

-Tony

[1] https://lore.kernel.org/all/20250430212106.369208-1-david.e.box@linux.intel.com/
Re: [PATCH v4 05/31] fs/resctrl: Set up Kconfig options for telemetry events
Posted by Reinette Chatre 7 months, 2 weeks ago
Hi Tony,

On 4/28/25 5:33 PM, Tony Luck wrote:
> Intel RMID based telemetry events are counted by each CPU core
> and then aggregated by one or more per-socket micro controllers.
> Enumeration support is provided by the Intel PMT subsystem.
> 
> N.B. Patches for the Intel PMT system are still in progress.
> They will define an INTEL_PMT_DISCOVERY Kconfig symbol that
> will be one of the dependencies. This is commented out for
> now. Final version will include this dependency.
> 
> arch/x86 selects this option based on:

Portion of changelog seems to be missing ... what does "this option" refer to?

> 
> X86_64: Counter registers are in MMIO space. There is no readq()
> function on 32-bit. Emulation is possible with readl(), but there
> are races. Running 32-bit kernels on systems that support this
> feature seems pointless.

This seems to be the primary dependency that requires the use of
a Kconfig symbol.

> 
> CPU_SUP_INTEL: It is an Intel specific feature.

While this is an Intel specific feature it looks to me as though 
intel_pmt_get_regions_by_feature() will return -ENODEV if it is not supported.

I think there is benefit to have this code compiled as much as
possible. An alternative to this CPU_SUP_INTEL dependency may be to add a
vendor check in the pre-mount callback to match the other Intel vs AMD,
but this may not be necessary?


> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  arch/x86/Kconfig                       | 1 +
>  drivers/platform/x86/intel/pmt/Kconfig | 7 +++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 5a09acf41c8e..19107fdb4264 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -508,6 +508,7 @@ config X86_CPU_RESCTRL
>  	bool "x86 CPU resource control support"
>  	depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
>  	depends on MISC_FILESYSTEMS
> +	select INTEL_AET_RESCTRL if (X86_64 && CPU_SUP_INTEL)
>  	select ARCH_HAS_CPU_RESCTRL
>  	select RESCTRL_FS
>  	select RESCTRL_FS_PSEUDO_LOCK
> diff --git a/drivers/platform/x86/intel/pmt/Kconfig b/drivers/platform/x86/intel/pmt/Kconfig
> index e916fc966221..3a8ce39d1004 100644
> --- a/drivers/platform/x86/intel/pmt/Kconfig
> +++ b/drivers/platform/x86/intel/pmt/Kconfig
> @@ -38,3 +38,10 @@ config INTEL_PMT_CRASHLOG
>  
>  	  To compile this driver as a module, choose M here: the module
>  	  will be called intel_pmt_crashlog.
> +
> +config INTEL_AET_RESCTRL
> +	depends on INTEL_PMT_TELEMETRY # && INTEL_PMT_DISCOVERY
> +	bool
> +	help
> +	  Architecture config should "select" this option to enable
> +	  support for RMID telemetry events in the resctrl file system.


Reinette