mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix
@ 2026-11-17 20:15 Babu Moger
  2026-11-17 20:15 ` [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix Babu Moger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Babu Moger @ 2026-11-17 20:15 UTC (permalink / raw)
  To: bp, tony.luck, reinette.chatre
  Cc: tglx, mingo, dave.hansen, x86, hpa, ben.horgan, Dave.Martin,
	james.morse, babu.moger, fustini, dapeng1.mi, peterz, superm1,
	thomas.lendacky, kim.phillips, prathyushi.nangia, acme, namhyung,
	linux-kernel

resctrl MSRs in the AMD address range (0xc0000xxx) are defined with an
MSR_IA32_ prefix even though they are AMD-specific and unrelated to Intel's
IA32 resctrl MSRs. The MSR_IA32_ prefix is misleading when reading or
grepping the codebase alongside the Intel MSR_IA32_* resctrl definitions
in msr-index.h.

Rename the AMD resctrl MSR definitions, update all call sites, and keep
the tools copy of msr-index.h in sync:

  MSR_IA32_MBA_BW_BASE      -> MSR_AMD_MBA_BW_BASE
  MSR_IA32_SMBA_BW_BASE     -> MSR_AMD_SMBA_BW_BASE
  MSR_IA32_L3_QOS_ABMC_CFG  -> MSR_AMD_L3_QOS_ABMC_CFG
  MSR_IA32_L3_QOS_EXT_CFG   -> MSR_AMD_L3_QOS_EXT_CFG
  MSR_IA32_EVT_CFG_BASE     -> MSR_AMD_EVT_CFG_BASE

No functional changes.

Suggested-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
---
v3: Added Reviewed-by(Reinette).

v2: Fixed few redundant 'MSR' texts.

v1: https://lore.kernel.org/lkml/96992e30d6c02ebb7bdb58f2d8060bfd61274649.1784739398.git.babu.moger@amd.com/
v2: https://lore.kernel.org/lkml/9ef5ec08d79c9c84f36b11251bd3189af1a38d52.1790721445.git.babu.moger@amd.com/
---
 arch/x86/include/asm/msr-index.h          | 10 +++++-----
 arch/x86/kernel/cpu/resctrl/core.c        |  4 ++--
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c |  6 +++---
 arch/x86/kernel/cpu/resctrl/internal.h    |  6 +++---
 arch/x86/kernel/cpu/resctrl/monitor.c     |  8 ++++----
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    |  4 ++--
 fs/resctrl/rdtgroup.c                     |  4 ++--
 tools/arch/x86/include/asm/msr-index.h    | 10 +++++-----
 8 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index c0914829a925..eda6029d4b56 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -1304,11 +1304,11 @@
 #define MSR_IA32_MBA_THRTL_BASE		0xd50
 
 /* - AMD: */
-#define MSR_IA32_MBA_BW_BASE		0xc0000200
-#define MSR_IA32_SMBA_BW_BASE		0xc0000280
-#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
-#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
-#define MSR_IA32_EVT_CFG_BASE		0xc0000400
+#define MSR_AMD_MBA_BW_BASE		0xc0000200
+#define MSR_AMD_SMBA_BW_BASE		0xc0000280
+#define MSR_AMD_L3_QOS_ABMC_CFG		0xc00003fd
+#define MSR_AMD_L3_QOS_EXT_CFG		0xc00003ff
+#define MSR_AMD_EVT_CFG_BASE		0xc0000400
 
 /* AMD-V MSRs */
 #define MSR_VM_CR                       0xc0010114
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 3294b18ba45f..5730e23e03ea 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -1024,10 +1024,10 @@ static __init void rdt_init_res_defs_amd(void)
 			r->cache.arch_has_sparse_bitmasks = true;
 			r->cache.min_cbm_bits = 0;
 		} else if (r->rid == RDT_RESOURCE_MBA) {
-			hw_res->msr_base = MSR_IA32_MBA_BW_BASE;
+			hw_res->msr_base = MSR_AMD_MBA_BW_BASE;
 			hw_res->msr_update = mba_wrmsr_amd;
 		} else if (r->rid == RDT_RESOURCE_SMBA) {
-			hw_res->msr_base = MSR_IA32_SMBA_BW_BASE;
+			hw_res->msr_base = MSR_AMD_SMBA_BW_BASE;
 			hw_res->msr_update = mba_wrmsr_amd;
 		}
 	}
diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index 62044489b052..25a5f0c8dc56 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -108,9 +108,9 @@ static void resctrl_sdciae_set_one_amd(void *arg)
 	bool *enable = arg;
 
 	if (*enable)
-		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
+		msr_set_bit(MSR_AMD_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
 	else
-		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
+		msr_clear_bit(MSR_AMD_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
 }
 
 static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
@@ -120,7 +120,7 @@ static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
 	/* Walking r->ctrl_domains, ensure it can't race with cpuhp */
 	lockdep_assert_cpus_held();
 
-	/* Update MSR_IA32_L3_QOS_EXT_CFG MSR on all the CPUs in all domains */
+	/* Update MSR_AMD_L3_QOS_EXT_CFG on all the CPUs in all domains */
 	list_for_each_entry_rcu(d, &r->ctrl_domains, hdr.list, lockdep_is_cpus_held())
 		on_each_cpu_mask(&d->hdr.cpu_mask, resctrl_sdciae_set_one_amd, &enable, 1);
 }
diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
index 03cb22f4e607..0efeb3312d9d 100644
--- a/arch/x86/kernel/cpu/resctrl/internal.h
+++ b/arch/x86/kernel/cpu/resctrl/internal.h
@@ -40,7 +40,7 @@ struct arch_mbm_state {
 	u64	prev_msr;
 };
 
-/* Setting bit 0 in L3_QOS_EXT_CFG enables the ABMC feature. */
+/* Setting bit 0 in MSR_AMD_L3_QOS_EXT_CFG enables the ABMC feature. */
 #define ABMC_ENABLE_BIT			0
 
 /*
@@ -49,7 +49,7 @@ struct arch_mbm_state {
 #define ABMC_EXTENDED_EVT_ID		BIT(31)
 #define ABMC_EVT_ID			BIT(0)
 
-/* Setting bit 1 in MSR_IA32_L3_QOS_EXT_CFG enables the SDCIAE feature. */
+/* Setting bit 1 in MSR_AMD_L3_QOS_EXT_CFG enables the SDCIAE feature. */
 #define SDCIAE_ENABLE_BIT		1
 
 /**
@@ -191,7 +191,7 @@ union cpuid_0x10_x_edx {
 };
 
 /*
- * ABMC counters are configured by writing to MSR_IA32_L3_QOS_ABMC_CFG.
+ * ABMC counters are configured by writing to MSR_AMD_L3_QOS_ABMC_CFG.
  *
  * @bw_type		: Event configuration that represents the memory
  *			  transactions being tracked by the @cntr_id.
diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
index a6a9090c4808..3ba9c8c26d5c 100644
--- a/arch/x86/kernel/cpu/resctrl/monitor.c
+++ b/arch/x86/kernel/cpu/resctrl/monitor.c
@@ -498,13 +498,13 @@ static void resctrl_abmc_set_one_amd(void *arg)
 	bool *enable = arg;
 
 	if (*enable)
-		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
+		msr_set_bit(MSR_AMD_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
 	else
-		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
+		msr_clear_bit(MSR_AMD_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
 }
 
 /*
- * ABMC enable/disable requires update of L3_QOS_EXT_CFG MSR on all the CPUs
+ * ABMC enable/disable requires update of MSR_AMD_L3_QOS_EXT_CFG on all the CPUs
  * associated with all monitor domains.
  */
 static void _resctrl_abmc_enable(struct rdt_resource *r, bool enable)
@@ -542,7 +542,7 @@ static void resctrl_abmc_config_one_amd(void *info)
 {
 	union l3_qos_abmc_cfg *abmc_cfg = info;
 
-	wrmsrq(MSR_IA32_L3_QOS_ABMC_CFG, abmc_cfg->full);
+	wrmsrq(MSR_AMD_L3_QOS_ABMC_CFG, abmc_cfg->full);
 }
 
 /*
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 6e4eeccd4891..8d0db76bb6f8 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -96,7 +96,7 @@ void resctrl_arch_mon_event_config_read(void *_config_info)
 		pr_warn_once("Invalid event id %d\n", config_info->evtid);
 		return;
 	}
-	rdmsrq(MSR_IA32_EVT_CFG_BASE + index, msrval);
+	rdmsrq(MSR_AMD_EVT_CFG_BASE + index, msrval);
 
 	/* Report only the valid event configuration bits */
 	config_info->mon_config = msrval & MAX_EVT_CONFIG_BITS;
@@ -112,7 +112,7 @@ void resctrl_arch_mon_event_config_write(void *_config_info)
 		pr_warn_once("Invalid event id %d\n", config_info->evtid);
 		return;
 	}
-	wrmsrq(MSR_IA32_EVT_CFG_BASE + index, config_info->mon_config);
+	wrmsrq(MSR_AMD_EVT_CFG_BASE + index, config_info->mon_config);
 }
 
 static void l3_qos_cfg_update(void *arg)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 443b41a4d467..a2047e7c4dba 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -1794,8 +1794,8 @@ static void mbm_config_write_domain(struct rdt_resource *r,
 	mon_info.mon_config = val;
 
 	/*
-	 * Update MSR_IA32_EVT_CFG_BASE MSR on one of the CPUs in the
-	 * domain. The MSRs offset from MSR MSR_IA32_EVT_CFG_BASE
+	 * Update MSR_AMD_EVT_CFG_BASE on one of the CPUs in the
+	 * domain. The MSRs offset from MSR_AMD_EVT_CFG_BASE
 	 * are scoped at the domain level. Writing any of these MSRs
 	 * on one CPU is observed by all the CPUs in the domain.
 	 */
diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h
index 9c26d4075c5f..87dd00bbc905 100644
--- a/tools/arch/x86/include/asm/msr-index.h
+++ b/tools/arch/x86/include/asm/msr-index.h
@@ -1297,11 +1297,11 @@
 #define MSR_IA32_MBA_THRTL_BASE		0xd50
 
 /* - AMD: */
-#define MSR_IA32_MBA_BW_BASE		0xc0000200
-#define MSR_IA32_SMBA_BW_BASE		0xc0000280
-#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
-#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
-#define MSR_IA32_EVT_CFG_BASE		0xc0000400
+#define MSR_AMD_MBA_BW_BASE		0xc0000200
+#define MSR_AMD_SMBA_BW_BASE		0xc0000280
+#define MSR_AMD_L3_QOS_ABMC_CFG		0xc00003fd
+#define MSR_AMD_L3_QOS_EXT_CFG		0xc00003ff
+#define MSR_AMD_EVT_CFG_BASE		0xc0000400
 
 /* AMD-V MSRs */
 #define MSR_VM_CR                       0xc0010114
-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix
  2026-11-17 20:15 [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Babu Moger
@ 2026-11-17 20:15 ` Babu Moger
  2026-11-24 19:22   ` [tip: x86/cache] " tip-bot2 for Babu Moger
  2026-11-24 17:23 ` [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Reinette Chatre
  2026-11-24 19:22 ` [tip: x86/cache] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD64_ prefix tip-bot2 for Babu Moger
  2 siblings, 1 reply; 5+ messages in thread
From: Babu Moger @ 2026-11-17 20:15 UTC (permalink / raw)
  To: bp, tony.luck, reinette.chatre
  Cc: tglx, mingo, dave.hansen, x86, hpa, ben.horgan, Dave.Martin,
	james.morse, babu.moger, fustini, dapeng1.mi, peterz, superm1,
	thomas.lendacky, kim.phillips, prathyushi.nangia, acme, namhyung,
	linux-kernel

resctrl code is split between arch and fs/resctrl/. Some files derive the
printk prefix from KBUILD_MODNAME, while others use "resctrl: ". Since
KBUILD_MODNAME follows the object name, messages use different prefixes
such as "rdtgroup:", "ctrlmondata:", and "pseudo_lock:".

Use "resctrl: " throughout both directories so all resctrl messages have
the same subsystem prefix and match indentation in files that already
use the right prefix.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
---
v3: Minor changelog update and added Reviewed-by (Reinette and Tony).

v2: New patch. The issue came up during the discussion of PLZA series.
    https://lore.kernel.org/lkml/432f0cbfb811aee3c8c51bbc42faf66174375d8b.1787772750.git.babu.moger@amd.com/

v2: https://lore.kernel.org/lkml/bc637e9a1f0c4624a01b8208f0e53582cbf21886.1790721445.git.babu.moger@amd.com/
---
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 2 +-
 arch/x86/kernel/cpu/resctrl/intel_aet.c   | 2 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 2 +-
 fs/resctrl/ctrlmondata.c                  | 2 +-
 fs/resctrl/pseudo_lock.c                  | 2 +-
 fs/resctrl/rdtgroup.c                     | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index 25a5f0c8dc56..77726cd13b3a 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -13,7 +13,7 @@
  * Software Developer Manual June 2016, volume 3, section 17.17.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/math.h>
diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c
index 66cd8c2c7a51..2f75cb7e79a7 100644
--- a/arch/x86/kernel/cpu/resctrl/intel_aet.c
+++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c
@@ -9,7 +9,7 @@
  *    Tony Luck <tony.luck@intel.com>
  */
 
-#define pr_fmt(fmt)   "resctrl: " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/bits.h>
 #include <linux/compiler_types.h>
diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
index d7caab0409b6..a58f9ba63c71 100644
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -9,7 +9,7 @@
  * Author: Reinette Chatre <reinette.chatre@intel.com>
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cacheflush.h>
 #include <linux/cpu.h>
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 8d0db76bb6f8..c27511db157f 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -10,7 +10,7 @@
  * Software Developer Manual.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/debugfs.h>
diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index 69123b2a3274..556032e0f0a7 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -13,7 +13,7 @@
  * Software Developer Manual June 2016, volume 3, section 17.17.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/kernfs.h>
diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
index 56ab63f19bad..656c1f1a3f4e 100644
--- a/fs/resctrl/pseudo_lock.c
+++ b/fs/resctrl/pseudo_lock.c
@@ -9,7 +9,7 @@
  * Author: Reinette Chatre <reinette.chatre@intel.com>
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cacheinfo.h>
 #include <linux/cpu.h>
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index a2047e7c4dba..cab46d6c8c40 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -10,7 +10,7 @@
  * Software Developer Manual.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/debugfs.h>
-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix
  2026-11-17 20:15 [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Babu Moger
  2026-11-17 20:15 ` [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix Babu Moger
@ 2026-11-24 17:23 ` Reinette Chatre
  2026-11-24 19:22 ` [tip: x86/cache] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD64_ prefix tip-bot2 for Babu Moger
  2 siblings, 0 replies; 5+ messages in thread
From: Reinette Chatre @ 2026-11-24 17:23 UTC (permalink / raw)
  To: bp, tglx, mingo, dave.hansen, x86
  Cc: hpa, ben.horgan, Dave.Martin, james.morse, fustini, dapeng1.mi,
	peterz, superm1, thomas.lendacky, kim.phillips,
	prathyushi.nangia, acme, namhyung, Babu Moger, linux-kernel,
	tony.luck

Dear x86 maintainers,

Could you please consider this patch as well as "x86,fs/resctrl: Use a consistent log prefix" submitted with it for inclusion?

Thank you very much.

Reinette

On 11/17/26 12:15 PM, Babu Moger wrote:
> resctrl MSRs in the AMD address range (0xc0000xxx) are defined with an
> MSR_IA32_ prefix even though they are AMD-specific and unrelated to Intel's
> IA32 resctrl MSRs. The MSR_IA32_ prefix is misleading when reading or
> grepping the codebase alongside the Intel MSR_IA32_* resctrl definitions
> in msr-index.h.
> 
> Rename the AMD resctrl MSR definitions, update all call sites, and keep
> the tools copy of msr-index.h in sync:
> 
>   MSR_IA32_MBA_BW_BASE      -> MSR_AMD_MBA_BW_BASE
>   MSR_IA32_SMBA_BW_BASE     -> MSR_AMD_SMBA_BW_BASE
>   MSR_IA32_L3_QOS_ABMC_CFG  -> MSR_AMD_L3_QOS_ABMC_CFG
>   MSR_IA32_L3_QOS_EXT_CFG   -> MSR_AMD_L3_QOS_EXT_CFG
>   MSR_IA32_EVT_CFG_BASE     -> MSR_AMD_EVT_CFG_BASE
> 
> No functional changes.
> 
> Suggested-by: Borislav Petkov (AMD) <bp@alien8.de>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
> v3: Added Reviewed-by(Reinette).
> 
> v2: Fixed few redundant 'MSR' texts.
> 
> v1: https://lore.kernel.org/lkml/96992e30d6c02ebb7bdb58f2d8060bfd61274649.1784739398.git.babu.moger@amd.com/
> v2: https://lore.kernel.org/lkml/9ef5ec08d79c9c84f36b11251bd3189af1a38d52.1790721445.git.babu.moger@amd.com/
> ---
>  arch/x86/include/asm/msr-index.h          | 10 +++++-----
>  arch/x86/kernel/cpu/resctrl/core.c        |  4 ++--
>  arch/x86/kernel/cpu/resctrl/ctrlmondata.c |  6 +++---
>  arch/x86/kernel/cpu/resctrl/internal.h    |  6 +++---
>  arch/x86/kernel/cpu/resctrl/monitor.c     |  8 ++++----
>  arch/x86/kernel/cpu/resctrl/rdtgroup.c    |  4 ++--
>  fs/resctrl/rdtgroup.c                     |  4 ++--
>  tools/arch/x86/include/asm/msr-index.h    | 10 +++++-----
>  8 files changed, 26 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
> index c0914829a925..eda6029d4b56 100644
> --- a/arch/x86/include/asm/msr-index.h
> +++ b/arch/x86/include/asm/msr-index.h
> @@ -1304,11 +1304,11 @@
>  #define MSR_IA32_MBA_THRTL_BASE		0xd50
>  
>  /* - AMD: */
> -#define MSR_IA32_MBA_BW_BASE		0xc0000200
> -#define MSR_IA32_SMBA_BW_BASE		0xc0000280
> -#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
> -#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
> -#define MSR_IA32_EVT_CFG_BASE		0xc0000400
> +#define MSR_AMD_MBA_BW_BASE		0xc0000200
> +#define MSR_AMD_SMBA_BW_BASE		0xc0000280
> +#define MSR_AMD_L3_QOS_ABMC_CFG		0xc00003fd
> +#define MSR_AMD_L3_QOS_EXT_CFG		0xc00003ff
> +#define MSR_AMD_EVT_CFG_BASE		0xc0000400
>  
>  /* AMD-V MSRs */
>  #define MSR_VM_CR                       0xc0010114
> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> index 3294b18ba45f..5730e23e03ea 100644
> --- a/arch/x86/kernel/cpu/resctrl/core.c
> +++ b/arch/x86/kernel/cpu/resctrl/core.c
> @@ -1024,10 +1024,10 @@ static __init void rdt_init_res_defs_amd(void)
>  			r->cache.arch_has_sparse_bitmasks = true;
>  			r->cache.min_cbm_bits = 0;
>  		} else if (r->rid == RDT_RESOURCE_MBA) {
> -			hw_res->msr_base = MSR_IA32_MBA_BW_BASE;
> +			hw_res->msr_base = MSR_AMD_MBA_BW_BASE;
>  			hw_res->msr_update = mba_wrmsr_amd;
>  		} else if (r->rid == RDT_RESOURCE_SMBA) {
> -			hw_res->msr_base = MSR_IA32_SMBA_BW_BASE;
> +			hw_res->msr_base = MSR_AMD_SMBA_BW_BASE;
>  			hw_res->msr_update = mba_wrmsr_amd;
>  		}
>  	}
> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> index 62044489b052..25a5f0c8dc56 100644
> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
> @@ -108,9 +108,9 @@ static void resctrl_sdciae_set_one_amd(void *arg)
>  	bool *enable = arg;
>  
>  	if (*enable)
> -		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
> +		msr_set_bit(MSR_AMD_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
>  	else
> -		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
> +		msr_clear_bit(MSR_AMD_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
>  }
>  
>  static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
> @@ -120,7 +120,7 @@ static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
>  	/* Walking r->ctrl_domains, ensure it can't race with cpuhp */
>  	lockdep_assert_cpus_held();
>  
> -	/* Update MSR_IA32_L3_QOS_EXT_CFG MSR on all the CPUs in all domains */
> +	/* Update MSR_AMD_L3_QOS_EXT_CFG on all the CPUs in all domains */
>  	list_for_each_entry_rcu(d, &r->ctrl_domains, hdr.list, lockdep_is_cpus_held())
>  		on_each_cpu_mask(&d->hdr.cpu_mask, resctrl_sdciae_set_one_amd, &enable, 1);
>  }
> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
> index 03cb22f4e607..0efeb3312d9d 100644
> --- a/arch/x86/kernel/cpu/resctrl/internal.h
> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
> @@ -40,7 +40,7 @@ struct arch_mbm_state {
>  	u64	prev_msr;
>  };
>  
> -/* Setting bit 0 in L3_QOS_EXT_CFG enables the ABMC feature. */
> +/* Setting bit 0 in MSR_AMD_L3_QOS_EXT_CFG enables the ABMC feature. */
>  #define ABMC_ENABLE_BIT			0
>  
>  /*
> @@ -49,7 +49,7 @@ struct arch_mbm_state {
>  #define ABMC_EXTENDED_EVT_ID		BIT(31)
>  #define ABMC_EVT_ID			BIT(0)
>  
> -/* Setting bit 1 in MSR_IA32_L3_QOS_EXT_CFG enables the SDCIAE feature. */
> +/* Setting bit 1 in MSR_AMD_L3_QOS_EXT_CFG enables the SDCIAE feature. */
>  #define SDCIAE_ENABLE_BIT		1
>  
>  /**
> @@ -191,7 +191,7 @@ union cpuid_0x10_x_edx {
>  };
>  
>  /*
> - * ABMC counters are configured by writing to MSR_IA32_L3_QOS_ABMC_CFG.
> + * ABMC counters are configured by writing to MSR_AMD_L3_QOS_ABMC_CFG.
>   *
>   * @bw_type		: Event configuration that represents the memory
>   *			  transactions being tracked by the @cntr_id.
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
> index a6a9090c4808..3ba9c8c26d5c 100644
> --- a/arch/x86/kernel/cpu/resctrl/monitor.c
> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c
> @@ -498,13 +498,13 @@ static void resctrl_abmc_set_one_amd(void *arg)
>  	bool *enable = arg;
>  
>  	if (*enable)
> -		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
> +		msr_set_bit(MSR_AMD_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
>  	else
> -		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
> +		msr_clear_bit(MSR_AMD_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
>  }
>  
>  /*
> - * ABMC enable/disable requires update of L3_QOS_EXT_CFG MSR on all the CPUs
> + * ABMC enable/disable requires update of MSR_AMD_L3_QOS_EXT_CFG on all the CPUs
>   * associated with all monitor domains.
>   */
>  static void _resctrl_abmc_enable(struct rdt_resource *r, bool enable)
> @@ -542,7 +542,7 @@ static void resctrl_abmc_config_one_amd(void *info)
>  {
>  	union l3_qos_abmc_cfg *abmc_cfg = info;
>  
> -	wrmsrq(MSR_IA32_L3_QOS_ABMC_CFG, abmc_cfg->full);
> +	wrmsrq(MSR_AMD_L3_QOS_ABMC_CFG, abmc_cfg->full);
>  }
>  
>  /*
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index 6e4eeccd4891..8d0db76bb6f8 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -96,7 +96,7 @@ void resctrl_arch_mon_event_config_read(void *_config_info)
>  		pr_warn_once("Invalid event id %d\n", config_info->evtid);
>  		return;
>  	}
> -	rdmsrq(MSR_IA32_EVT_CFG_BASE + index, msrval);
> +	rdmsrq(MSR_AMD_EVT_CFG_BASE + index, msrval);
>  
>  	/* Report only the valid event configuration bits */
>  	config_info->mon_config = msrval & MAX_EVT_CONFIG_BITS;
> @@ -112,7 +112,7 @@ void resctrl_arch_mon_event_config_write(void *_config_info)
>  		pr_warn_once("Invalid event id %d\n", config_info->evtid);
>  		return;
>  	}
> -	wrmsrq(MSR_IA32_EVT_CFG_BASE + index, config_info->mon_config);
> +	wrmsrq(MSR_AMD_EVT_CFG_BASE + index, config_info->mon_config);
>  }
>  
>  static void l3_qos_cfg_update(void *arg)
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index 443b41a4d467..a2047e7c4dba 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -1794,8 +1794,8 @@ static void mbm_config_write_domain(struct rdt_resource *r,
>  	mon_info.mon_config = val;
>  
>  	/*
> -	 * Update MSR_IA32_EVT_CFG_BASE MSR on one of the CPUs in the
> -	 * domain. The MSRs offset from MSR MSR_IA32_EVT_CFG_BASE
> +	 * Update MSR_AMD_EVT_CFG_BASE on one of the CPUs in the
> +	 * domain. The MSRs offset from MSR_AMD_EVT_CFG_BASE
>  	 * are scoped at the domain level. Writing any of these MSRs
>  	 * on one CPU is observed by all the CPUs in the domain.
>  	 */
> diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h
> index 9c26d4075c5f..87dd00bbc905 100644
> --- a/tools/arch/x86/include/asm/msr-index.h
> +++ b/tools/arch/x86/include/asm/msr-index.h
> @@ -1297,11 +1297,11 @@
>  #define MSR_IA32_MBA_THRTL_BASE		0xd50
>  
>  /* - AMD: */
> -#define MSR_IA32_MBA_BW_BASE		0xc0000200
> -#define MSR_IA32_SMBA_BW_BASE		0xc0000280
> -#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
> -#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
> -#define MSR_IA32_EVT_CFG_BASE		0xc0000400
> +#define MSR_AMD_MBA_BW_BASE		0xc0000200
> +#define MSR_AMD_SMBA_BW_BASE		0xc0000280
> +#define MSR_AMD_L3_QOS_ABMC_CFG		0xc00003fd
> +#define MSR_AMD_L3_QOS_EXT_CFG		0xc00003ff
> +#define MSR_AMD_EVT_CFG_BASE		0xc0000400
>  
>  /* AMD-V MSRs */
>  #define MSR_VM_CR                       0xc0010114


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: x86/cache] x86,fs/resctrl: Use a consistent log prefix
  2026-11-17 20:15 ` [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix Babu Moger
@ 2026-11-24 19:22   ` tip-bot2 for Babu Moger
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Babu Moger @ 2026-11-24 19:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Reinette Chatre, Babu Moger, Borislav Petkov (AMD),
	Tony Luck, x86, linux-kernel

The following commit has been merged into the x86/cache branch of tip:

Commit-ID:     712f550549864a5061a3acc3ef1bb61c07e9e66c
Gitweb:        https://git.kernel.org/tip/712f550549864a5061a3acc3ef1bb61c07e9e66c
Author:        Babu Moger <babu.moger@amd.com>
AuthorDate:    Tue, 17 Nov 2026 14:15:13 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 24 Nov 2026 11:12:34 -08:00

x86,fs/resctrl: Use a consistent log prefix

resctrl code is split between arch and fs/resctrl/. Some files derive the
printk prefix from KBUILD_MODNAME, while others use "resctrl: ". Since
KBUILD_MODNAME follows the object name, messages use different prefixes
such as "rdtgroup:", "ctrlmondata:", and "pseudo_lock:".

Use "resctrl: " throughout both directories so all resctrl messages have
the same subsystem prefix and match indentation in files that already
use the right prefix.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://patch.msgid.link/b0b288783579ca22af73836276fa2f97bdc85f58.1794946513.git.babu.moger@amd.com
---
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 2 +-
 arch/x86/kernel/cpu/resctrl/intel_aet.c   | 2 +-
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 2 +-
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    | 2 +-
 fs/resctrl/ctrlmondata.c                  | 2 +-
 fs/resctrl/pseudo_lock.c                  | 2 +-
 fs/resctrl/rdtgroup.c                     | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index e2afeed..46ec3fa 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -13,7 +13,7 @@
  * Software Developer Manual June 2016, volume 3, section 17.17.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/math.h>
diff --git a/arch/x86/kernel/cpu/resctrl/intel_aet.c b/arch/x86/kernel/cpu/resctrl/intel_aet.c
index 66cd8c2..2f75cb7 100644
--- a/arch/x86/kernel/cpu/resctrl/intel_aet.c
+++ b/arch/x86/kernel/cpu/resctrl/intel_aet.c
@@ -9,7 +9,7 @@
  *    Tony Luck <tony.luck@intel.com>
  */
 
-#define pr_fmt(fmt)   "resctrl: " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/bits.h>
 #include <linux/compiler_types.h>
diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
index d7caab0..a58f9ba 100644
--- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
+++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
@@ -9,7 +9,7 @@
  * Author: Reinette Chatre <reinette.chatre@intel.com>
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cacheflush.h>
 #include <linux/cpu.h>
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 70d020c..581a489 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -10,7 +10,7 @@
  * Software Developer Manual.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/debugfs.h>
diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index 69123b2..556032e 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -13,7 +13,7 @@
  * Software Developer Manual June 2016, volume 3, section 17.17.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/kernfs.h>
diff --git a/fs/resctrl/pseudo_lock.c b/fs/resctrl/pseudo_lock.c
index 56ab63f..656c1f1 100644
--- a/fs/resctrl/pseudo_lock.c
+++ b/fs/resctrl/pseudo_lock.c
@@ -9,7 +9,7 @@
  * Author: Reinette Chatre <reinette.chatre@intel.com>
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cacheinfo.h>
 #include <linux/cpu.h>
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 559bccb..ec99b27 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -10,7 +10,7 @@
  * Software Developer Manual.
  */
 
-#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+#define pr_fmt(fmt)	"resctrl: " fmt
 
 #include <linux/cpu.h>
 #include <linux/debugfs.h>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: x86/cache] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD64_ prefix
  2026-11-17 20:15 [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Babu Moger
  2026-11-17 20:15 ` [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix Babu Moger
  2026-11-24 17:23 ` [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Reinette Chatre
@ 2026-11-24 19:22 ` tip-bot2 for Babu Moger
  2 siblings, 0 replies; 5+ messages in thread
From: tip-bot2 for Babu Moger @ 2026-11-24 19:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Borislav Petkov (AMD), Babu Moger, Reinette Chatre, x86, linux-kernel

The following commit has been merged into the x86/cache branch of tip:

Commit-ID:     3d414bf38740b3586ea25706dcec66584b78f895
Gitweb:        https://git.kernel.org/tip/3d414bf38740b3586ea25706dcec66584b78f895
Author:        Babu Moger <babu.moger@amd.com>
AuthorDate:    Tue, 17 Nov 2026 14:15:12 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Tue, 24 Nov 2026 11:04:24 -08:00

x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD64_ prefix

resctrl MSRs in the AMD address range (0xc0000xxx) are defined with an
MSR_IA32_ prefix even though they are AMD-specific and unrelated to Intel's
IA32 resctrl MSRs. The MSR_IA32_ prefix is misleading when reading or
grepping the codebase alongside the Intel MSR_IA32_* resctrl definitions
in msr-index.h.

Rename the AMD resctrl MSR definitions, update all call sites, and keep
the tools copy of msr-index.h in sync:

  MSR_IA32_MBA_BW_BASE      -> MSR_AMD64_MBA_BW_BASE
  MSR_IA32_SMBA_BW_BASE     -> MSR_AMD64_SMBA_BW_BASE
  MSR_IA32_L3_QOS_ABMC_CFG  -> MSR_AMD64_L3_QOS_ABMC_CFG
  MSR_IA32_L3_QOS_EXT_CFG   -> MSR_AMD64_L3_QOS_EXT_CFG
  MSR_IA32_EVT_CFG_BASE     -> MSR_AMD64_EVT_CFG_BASE

No functional changes.

  [ bp: Use the MSR_AMD64_ prefix because all those are architectural, see
    "Table A-1. MSRs of the AMD64 Architecture" in the APM v2.]

Suggested-by: Borislav Petkov (AMD) <bp@alien8.de>
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://patch.msgid.link/9b55776701b2692772968a681a518ecd8326643e.1794946513.git.babu.moger@amd.com
---
 arch/x86/include/asm/msr-index.h          | 10 +++++-----
 arch/x86/kernel/cpu/resctrl/core.c        |  4 ++--
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c |  6 +++---
 arch/x86/kernel/cpu/resctrl/internal.h    |  6 +++---
 arch/x86/kernel/cpu/resctrl/monitor.c     |  8 ++++----
 arch/x86/kernel/cpu/resctrl/rdtgroup.c    |  4 ++--
 fs/resctrl/rdtgroup.c                     |  4 ++--
 tools/arch/x86/include/asm/msr-index.h    | 10 +++++-----
 8 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index c091482..1c7b5d2 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -1304,11 +1304,11 @@
 #define MSR_IA32_MBA_THRTL_BASE		0xd50
 
 /* - AMD: */
-#define MSR_IA32_MBA_BW_BASE		0xc0000200
-#define MSR_IA32_SMBA_BW_BASE		0xc0000280
-#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
-#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
-#define MSR_IA32_EVT_CFG_BASE		0xc0000400
+#define MSR_AMD64_MBA_BW_BASE		0xc0000200
+#define MSR_AMD64_SMBA_BW_BASE		0xc0000280
+#define MSR_AMD64_L3_QOS_ABMC_CFG	0xc00003fd
+#define MSR_AMD64_L3_QOS_EXT_CFG	0xc00003ff
+#define MSR_AMD64_EVT_CFG_BASE		0xc0000400
 
 /* AMD-V MSRs */
 #define MSR_VM_CR                       0xc0010114
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index e647c3a..8019348 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -1025,10 +1025,10 @@ static __init void rdt_init_res_defs_amd(void)
 			r->cache.arch_has_sparse_bitmasks = true;
 			r->cache.min_cbm_bits = 0;
 		} else if (r->rid == RDT_RESOURCE_MBA) {
-			hw_res->msr_base = MSR_IA32_MBA_BW_BASE;
+			hw_res->msr_base = MSR_AMD64_MBA_BW_BASE;
 			hw_res->msr_update = mba_wrmsr_amd;
 		} else if (r->rid == RDT_RESOURCE_SMBA) {
-			hw_res->msr_base = MSR_IA32_SMBA_BW_BASE;
+			hw_res->msr_base = MSR_AMD64_SMBA_BW_BASE;
 			hw_res->msr_update = mba_wrmsr_amd;
 		}
 	}
diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index 6204448..e2afeed 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -108,9 +108,9 @@ static void resctrl_sdciae_set_one_amd(void *arg)
 	bool *enable = arg;
 
 	if (*enable)
-		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
+		msr_set_bit(MSR_AMD64_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
 	else
-		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
+		msr_clear_bit(MSR_AMD64_L3_QOS_EXT_CFG, SDCIAE_ENABLE_BIT);
 }
 
 static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
@@ -120,7 +120,7 @@ static void _resctrl_sdciae_enable(struct rdt_resource *r, bool enable)
 	/* Walking r->ctrl_domains, ensure it can't race with cpuhp */
 	lockdep_assert_cpus_held();
 
-	/* Update MSR_IA32_L3_QOS_EXT_CFG MSR on all the CPUs in all domains */
+	/* Update MSR_AMD64_L3_QOS_EXT_CFG on all the CPUs in all domains */
 	list_for_each_entry_rcu(d, &r->ctrl_domains, hdr.list, lockdep_is_cpus_held())
 		on_each_cpu_mask(&d->hdr.cpu_mask, resctrl_sdciae_set_one_amd, &enable, 1);
 }
diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
index 670ce92..5ddf217 100644
--- a/arch/x86/kernel/cpu/resctrl/internal.h
+++ b/arch/x86/kernel/cpu/resctrl/internal.h
@@ -40,7 +40,7 @@ struct arch_mbm_state {
 	u64	prev_msr;
 };
 
-/* Setting bit 0 in L3_QOS_EXT_CFG enables the ABMC feature. */
+/* Setting bit 0 in MSR_AMD64_L3_QOS_EXT_CFG enables the ABMC feature. */
 #define ABMC_ENABLE_BIT			0
 
 /*
@@ -49,7 +49,7 @@ struct arch_mbm_state {
 #define ABMC_EXTENDED_EVT_ID		BIT(31)
 #define ABMC_EVT_ID			BIT(0)
 
-/* Setting bit 1 in MSR_IA32_L3_QOS_EXT_CFG enables the SDCIAE feature. */
+/* Setting bit 1 in MSR_AMD64_L3_QOS_EXT_CFG enables the SDCIAE feature. */
 #define SDCIAE_ENABLE_BIT		1
 
 /**
@@ -191,7 +191,7 @@ union cpuid_0x10_x_edx {
 };
 
 /*
- * ABMC counters are configured by writing to MSR_IA32_L3_QOS_ABMC_CFG.
+ * ABMC counters are configured by writing to MSR_AMD64_L3_QOS_ABMC_CFG.
  *
  * @bw_type		: Event configuration that represents the memory
  *			  transactions being tracked by the @cntr_id.
diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
index 3838e0a..cd09bdf 100644
--- a/arch/x86/kernel/cpu/resctrl/monitor.c
+++ b/arch/x86/kernel/cpu/resctrl/monitor.c
@@ -498,13 +498,13 @@ static void resctrl_abmc_set_one_amd(void *arg)
 	bool *enable = arg;
 
 	if (*enable)
-		msr_set_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
+		msr_set_bit(MSR_AMD64_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
 	else
-		msr_clear_bit(MSR_IA32_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
+		msr_clear_bit(MSR_AMD64_L3_QOS_EXT_CFG, ABMC_ENABLE_BIT);
 }
 
 /*
- * ABMC enable/disable requires update of L3_QOS_EXT_CFG MSR on all the CPUs
+ * ABMC enable/disable requires update of MSR_AMD64_L3_QOS_EXT_CFG on all the CPUs
  * associated with all monitor domains.
  */
 static void _resctrl_abmc_enable(struct rdt_resource *r, bool enable)
@@ -542,7 +542,7 @@ static void resctrl_abmc_config_one_amd(void *info)
 {
 	union l3_qos_abmc_cfg *abmc_cfg = info;
 
-	wrmsrq(MSR_IA32_L3_QOS_ABMC_CFG, abmc_cfg->full);
+	wrmsrq(MSR_AMD64_L3_QOS_ABMC_CFG, abmc_cfg->full);
 }
 
 /*
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 6e4eecc..70d020c 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -96,7 +96,7 @@ void resctrl_arch_mon_event_config_read(void *_config_info)
 		pr_warn_once("Invalid event id %d\n", config_info->evtid);
 		return;
 	}
-	rdmsrq(MSR_IA32_EVT_CFG_BASE + index, msrval);
+	rdmsrq(MSR_AMD64_EVT_CFG_BASE + index, msrval);
 
 	/* Report only the valid event configuration bits */
 	config_info->mon_config = msrval & MAX_EVT_CONFIG_BITS;
@@ -112,7 +112,7 @@ void resctrl_arch_mon_event_config_write(void *_config_info)
 		pr_warn_once("Invalid event id %d\n", config_info->evtid);
 		return;
 	}
-	wrmsrq(MSR_IA32_EVT_CFG_BASE + index, config_info->mon_config);
+	wrmsrq(MSR_AMD64_EVT_CFG_BASE + index, config_info->mon_config);
 }
 
 static void l3_qos_cfg_update(void *arg)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 443b41a..559bccb 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -1794,8 +1794,8 @@ static void mbm_config_write_domain(struct rdt_resource *r,
 	mon_info.mon_config = val;
 
 	/*
-	 * Update MSR_IA32_EVT_CFG_BASE MSR on one of the CPUs in the
-	 * domain. The MSRs offset from MSR MSR_IA32_EVT_CFG_BASE
+	 * Update MSR_AMD64_EVT_CFG_BASE on one of the CPUs in the
+	 * domain. The MSRs offset from MSR_AMD64_EVT_CFG_BASE
 	 * are scoped at the domain level. Writing any of these MSRs
 	 * on one CPU is observed by all the CPUs in the domain.
 	 */
diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h
index 9c26d40..197f787 100644
--- a/tools/arch/x86/include/asm/msr-index.h
+++ b/tools/arch/x86/include/asm/msr-index.h
@@ -1297,11 +1297,11 @@
 #define MSR_IA32_MBA_THRTL_BASE		0xd50
 
 /* - AMD: */
-#define MSR_IA32_MBA_BW_BASE		0xc0000200
-#define MSR_IA32_SMBA_BW_BASE		0xc0000280
-#define MSR_IA32_L3_QOS_ABMC_CFG	0xc00003fd
-#define MSR_IA32_L3_QOS_EXT_CFG		0xc00003ff
-#define MSR_IA32_EVT_CFG_BASE		0xc0000400
+#define MSR_AMD64_MBA_BW_BASE		0xc0000200
+#define MSR_AMD64_SMBA_BW_BASE		0xc0000280
+#define MSR_AMD64_L3_QOS_ABMC_CFG	0xc00003fd
+#define MSR_AMD64_L3_QOS_EXT_CFG	0xc00003ff
+#define MSR_AMD64_EVT_CFG_BASE		0xc0000400
 
 /* AMD-V MSRs */
 #define MSR_VM_CR                       0xc0010114

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-24 19:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 20:15 [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Babu Moger
2026-11-17 20:15 ` [PATCH v3 2/2] x86,fs/resctrl: Use a consistent log prefix Babu Moger
2026-11-24 19:22   ` [tip: x86/cache] " tip-bot2 for Babu Moger
2026-11-24 17:23 ` [PATCH v3 1/2] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD_ prefix Reinette Chatre
2026-11-24 19:22 ` [tip: x86/cache] x86,fs/resctrl: Rename AMD resctrl MSR defines to use MSR_AMD64_ prefix tip-bot2 for Babu Moger

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®