]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/resctrl: Remove the rdt_mon_features global variable
authorTony Luck <tony.luck@intel.com>
Fri, 5 Sep 2025 21:34:02 +0000 (16:34 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 15 Sep 2025 09:55:50 +0000 (11:55 +0200)
rdt_mon_features is used as a bitmask of enabled monitor events. A monitor
event's status is now maintained in mon_evt::enabled with all monitor events'
mon_evt structures found in the filesystem's mon_event_all[] array.

Remove the remaining uses of rdt_mon_features.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/cover.1757108044.git.babu.moger@amd.com
arch/x86/include/asm/resctrl.h
arch/x86/kernel/cpu/resctrl/core.c
arch/x86/kernel/cpu/resctrl/monitor.c

index b1dd5d6b87db4e3f31d1bd425842867f3426c508..575f8408a9e7c69fae090c1dfe9b5e753c7cb6ae 100644 (file)
@@ -44,7 +44,6 @@ DECLARE_PER_CPU(struct resctrl_pqr_state, pqr_state);
 
 extern bool rdt_alloc_capable;
 extern bool rdt_mon_capable;
-extern unsigned int rdt_mon_features;
 
 DECLARE_STATIC_KEY_FALSE(rdt_enable_key);
 DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key);
index 1a319ce9328c708554d3c9b8077565a2c3ff8b07..5d14f9a14eda545a09e163fee2f8f5116fed420b 100644 (file)
@@ -863,21 +863,22 @@ static __init bool get_rdt_alloc_resources(void)
 static __init bool get_rdt_mon_resources(void)
 {
        struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
+       bool ret = false;
 
        if (rdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC)) {
                resctrl_enable_mon_event(QOS_L3_OCCUP_EVENT_ID);
-               rdt_mon_features |= (1 << QOS_L3_OCCUP_EVENT_ID);
+               ret = true;
        }
        if (rdt_cpu_has(X86_FEATURE_CQM_MBM_TOTAL)) {
                resctrl_enable_mon_event(QOS_L3_MBM_TOTAL_EVENT_ID);
-               rdt_mon_features |= (1 << QOS_L3_MBM_TOTAL_EVENT_ID);
+               ret = true;
        }
        if (rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL)) {
                resctrl_enable_mon_event(QOS_L3_MBM_LOCAL_EVENT_ID);
-               rdt_mon_features |= (1 << QOS_L3_MBM_LOCAL_EVENT_ID);
+               ret = true;
        }
 
-       if (!rdt_mon_features)
+       if (!ret)
                return false;
 
        return !rdt_get_mon_l3_config(r);
index 61d38517e2bf4aa25113b73e88940ed6af0ab447..07f8ab097cbe143c77cdbe8808f3b6318e869a52 100644 (file)
  */
 bool rdt_mon_capable;
 
-/*
- * Global to indicate which monitoring events are enabled.
- */
-unsigned int rdt_mon_features;
-
 #define CF(cf) ((unsigned long)(1048576 * (cf) + 0.5))
 
 static int snc_nodes_per_l3_cache = 1;