linux/arch/x86/kernel/cpu/resctrl
James Morse e557999f80 x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read()
Depending on the number of monitors available, Arm's MPAM may need to
allocate a monitor prior to reading the counter value. Allocating a
contended resource may involve sleeping.

__check_limbo() and mon_event_count() each make multiple calls to
resctrl_arch_rmid_read(), to avoid extra work on contended systems,
the allocation should be valid for multiple invocations of
resctrl_arch_rmid_read().

The memory or hardware allocated is not specific to a domain.

Add arch hooks for this allocation, which need calling before
resctrl_arch_rmid_read(). The allocated monitor is passed to
resctrl_arch_rmid_read(), then freed again afterwards. The helper
can be called on any CPU, and can sleep.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Babu Moger <babu.moger@amd.com>
Tested-by: Shaopeng Tan <tan.shaopeng@fujitsu.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64
Link: https://lore.kernel.org/r/20240213184438.16675-16-james.morse@arm.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
2024-02-16 19:18:32 +01:00
..
core.c x86/resctrl: Access per-rmid structures by index 2024-02-16 19:18:31 +01:00
ctrlmondata.c x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read() 2024-02-16 19:18:32 +01:00
internal.h x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read() 2024-02-16 19:18:32 +01:00
Makefile
monitor.c x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read() 2024-02-16 19:18:32 +01:00
pseudo_lock.c x86/resctrl: Allow RMID allocation to be scoped by CLOSID 2024-02-16 19:18:31 +01:00
pseudo_lock_event.h
rdtgroup.c x86/resctrl: Move CLOSID/RMID matching and setting to use helpers 2024-02-16 19:18:32 +01:00