Thread (21 messages) flat view 21 messages, 3 authors, 1d ago

Re: [PATCH v2 1/3] x86/resctrl: Fix ABMC counter programming for extended counter ranges

From: Reinette Chatre <reinette.chatre@intel.com>
Date: 2026-09-14 21:31:43
Also in: lkml

Hi Babu,

On 9/14/26 10:17 AM, Babu Moger wrote:
On 9/11/26 17:03, Reinette Chatre wrote:
quoted
On 9/4/26 11:06 AM, Babu Moger wrote:
...
quoted
quoted
Fix the issues with the following changes:

1. Update the cntr_id field handling to support the full hardware ABMC
counter range and ensure that counter programming does not interfere with
unrelated counters.
Sashiko's assessment that this statement is not accurate looks correct to me.

Looks like the enumeration needs a check to limit the number of supported
counters if the hardware supports more than what can be configured? It seems
awkward that such hardware could exist and unclear why the spec has a mismatch in

You're right. The spec overlooked this scenario. I've notified the concerned team.


Do you want me add this check?

-               r->mon.num_mbm_cntrs = (ebx & GENMASK(15, 0)) + 1;
+               r->mon.num_mbm_cntrs = (ebx & GENMASK(12, 0)) + 1;
Yes please.
quoted
the number of bits here. Even if cntr_id expands further to use the remaining
reserved bits it would still not be sufficient to configure all the numbers
that hardware may claim to support. Are there perhaps more field width changes
in this upcoming spec update?
Two fields(ctrl_id and bw_src) in here are changing for this register. I dont know about other changes yet.
quoted
quoted
2. Expand the bw_src field to 15 bits.
Do the comments describing the RMID field width when reading the monitoring
data (__cntr_id_read() and __rmid_read_phys()) need an update also?
The RMID field width is expected to change. We can revisit this when that happens.

This patch is that change, no? bw_src is expanded to 15 bits, and bw_src contains
the RMID.

This is the new RMID field width for monitoring configuration, after configuration
the counter needs to be read for the monitoring data via MSR_IA32_QM_EVTSEL and per
__cntr_id_read() the RMID field is still restricted (although not enforce by resctrl)
to 12 bits:

	* 43:32   RMID            RMID or counter ID in ABMC mode

resctrl also supports switching between "default" and "mbm_event" mode and there
is no support for the number of RMIDs changing between the modes ... this reading
an event in "default" mode should support the same number of RMIDs as 
"mbm_event" mode and we see in __rmid_read_phys() (although, again not enforced)
that it supports even fewer bits for RMID
	
	IA32_QM_EVTSEL.RMID (bits 41:32) are configured with valid RMID

Looks like after this patch there are quite a few different field widths for RMID
between what is documented, used directly, and actually enforced.
quoted
quoted
3. Change "unsigned long" to u64 to fix truncation on 32-bit x86.
Sashiko found that this change by itself is not sufficient to address issues
with 32-bit. What do you think of dropping this part of the patch and instead
adding your support to:

https://lore.kernel.org/lkml/20260831174421.13921-22-tony.luck@intel.com/ (local) ?
Yes. I agree and support that approach. Looks like all the maintainers are inline with dropping 32. Will drop this change.
If you do support that change, please consider adding a tag.

Reinette
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help