Re: [PATCH v5 05/10] x86/resctrl: Parse ACPI CMRC table
From: Chen, Yu C
Date: Tue Jul 14 2026 - 12:28:15 EST
Hi Reinette,
On 7/11/2026 7:46 AM, Reinette Chatre wrote:
Hi Chenyu,
On 7/1/26 6:46 AM, Chen Yu wrote:
The CMRC (Cache Monitoring Registers for CPU Agents Description)
sub-table of ERDT describes the MMIO registers used to read
cache monitoring counters (e.g. LLC occupancy) for an RMD.
Please use the entire line length available (please check all changelogs).
Some context for this request:
https://lore.kernel.org/lkml/20250916105447.GCaMlB976WLxHHeNMD@fat_crate.local/
OK, will use 80 characters per line.
Parse each CMRC sub-table, ioremap its register window, and save
the CMRC pointer in the corresponding ERDT domain entry so that
later monitoring code can read the counters via MMIO.
Is the "save the CMRC pointer ..." referring to how resctrl makes
a copy of the CMRC table? If so, that is very different from
"saving a pointer".
It is a copy of the original table content. Let me adjust this description.
[ ... ]
+static __init int cmrc_init(struct acpi_subtbl_hdr_16 *subtbl,
+ struct erdt_domain_info *domain_info)
+{
+ struct acpi_erdt_cmrc *cmrc = (struct acpi_erdt_cmrc *)subtbl;
+
+ if (subtbl->length < sizeof(*cmrc)) {
I think it will be helpful if the ERDT parsing code uses consistent patterns. Here,
for example, now that a pointer of accurate type is available via cmrc, can cmrc
be referenced instead to be consistent with cacd_init()?
OK, I will use cmrc->length to keep consistency.
+
static inline struct acpi_subtbl_hdr_16 *rmdd_subtbl(struct acpi_erdt_rmdd *rmdd)
{
return (void *)rmdd + sizeof(*rmdd);
@@ -178,6 +215,13 @@ static __init bool parse_rmdd_entry(struct acpi_subtbl_hdr_16 *rmdd_hdr)
goto cleanup;
subtbl_mask |= BIT(ACPI_ERDT_TYPE_CACD);
+ break;
+ case ACPI_ERDT_TYPE_CMRC:
+ /* TBD: Only 1 CMRR per domain is allowed? */
Who are you asking this question to?
The current code supports 1 CMRC per domain. The spec says there are "at least
one instance of this structure for each RDT domain" But it is unclear to me
how to route to different CMRC. I'll check with the arch team to figure out.
thanks,
Chenyu