Re: [PATCH v11 14/23] x86/resctrl: Implement resctrl_arch_config_cntr() to assign a counter with ABMC
From: James Morse
Date: Fri Feb 21 2025 - 13:09:16 EST
Hi Babu,
On 22/01/2025 20:20, Babu Moger wrote:
> The ABMC feature provides an option to the user to assign a hardware
> counter to an RMID, event pair and monitor the bandwidth as long as it
> is assigned. The assigned RMID will be tracked by the hardware until the
> user unassigns it manually.
>
> Implement an architecture-specific handler to assign and unassign the
> counter. Configure counters by writing to the L3_QOS_ABMC_CFG MSR,
> specifying the counter ID, bandwidth source (RMID), and event
> configuration.
>
> The feature details are documented in the APM listed below [1].
> [1] AMD64 Architecture Programmer's Manual Volume 2: System Programming
> Publication # 24593 Revision 3.41 section 19.3.3.3 Assignable Bandwidth
> Monitoring (ABMC).
> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
> index acac7972cea4..161d3feb567c 100644
> --- a/arch/x86/kernel/cpu/resctrl/internal.h
> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
> @@ -724,4 +724,7 @@ unsigned int mon_event_config_index_get(u32 evtid);
> void resctrl_arch_mon_event_config_set(void *info);
> u32 resctrl_arch_mon_event_config_get(struct rdt_mon_domain *d,
> enum resctrl_event_id eventid);
> +int resctrl_arch_config_cntr(struct rdt_resource *r, struct rdt_mon_domain *d,
> + enum resctrl_event_id evtid, u32 rmid, u32 closid,
> + u32 cntr_id, bool assign);
> #endif /* _ASM_X86_RESCTRL_INTERNAL_H */
Could this be added to include/linux/resctrl.h instead? Its where it needs to end up
eventually.
Thanks,
James