]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86,fs/resctrl: Implement resctrl_arch_config_cntr() to assign a counter with ABMC
authorBabu Moger <babu.moger@amd.com>
Fri, 5 Sep 2025 21:34:15 +0000 (16:34 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 15 Sep 2025 10:20:29 +0000 (12:20 +0200)
commitf7a4fb22312646329ba21bc58958fd83fb9fc15d
tree54b9f95f5ab273d41f45179e12134ebdb8c9d551
parentebebda853633de389ba2c6737f8ca38405713e90
x86,fs/resctrl: Implement resctrl_arch_config_cntr() to assign a counter with ABMC

The ABMC feature allows users to assign a hardware counter to an RMID,
event pair and monitor bandwidth usage as long as it is assigned. The
hardware continues to track the assigned counter until it is explicitly
unassigned by the user.

Implement an x86 architecture-specific handler to configure a counter. This
architecture specific handler is called by resctrl fs when a counter is
assigned or unassigned as well as when an already assigned counter's
configuration should be updated. Configure counters by writing to the
L3_QOS_ABMC_CFG MSR, specifying the counter ID, bandwidth source (RMID),
and event configuration.

The ABMC feature details are documented in APM [1] available from [2].
[1] AMD64 Architecture Programmer's Manual Volume 2: System Programming
    Publication # 24593 Revision 3.41 section 19.3.3.3 Assignable Bandwidth
    Monitoring (ABMC).

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
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
arch/x86/kernel/cpu/resctrl/monitor.c
include/linux/resctrl.h