1
linux/arch/x86/kernel/cpu/resctrl
Nathan Chancellor d5fd042bf4 x86/resctrl: Annotate get_mem_config() functions as __init
After a recent LLVM change [1] that deduces __cold on functions that only call
cold code (such as __init functions), there is a section mismatch warning from
__get_mem_config_intel(), which got moved to .text.unlikely. as a result of
that optimization:

  WARNING: modpost: vmlinux: section mismatch in reference: \
  __get_mem_config_intel+0x77 (section: .text.unlikely.) -> thread_throttle_mode_init (section: .init.text)

Mark __get_mem_config_intel() as __init as well since it is only called
from __init code, which clears up the warning.

While __rdt_get_mem_config_amd() does not exhibit a warning because it
does not call any __init code, it is a similar function that is only
called from __init code like __get_mem_config_intel(), so mark it __init
as well to keep the code symmetrical.

CONFIG_SECTION_MISMATCH_WARN_ONLY=n would turn this into a fatal error.

Fixes: 05b93417ce ("x86/intel_rdt/mba: Add primary support for Memory Bandwidth Allocation (MBA)")
Fixes: 4d05bf71f1 ("x86/resctrl: Introduce AMD QOS feature")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: <stable@kernel.org>
Link: 6b11573b8c [1]
Link: https://lore.kernel.org/r/20240917-x86-restctrl-get_mem_config_intel-init-v3-1-10d521256284@kernel.org
2024-10-08 21:05:10 +02:00
..
core.c x86/resctrl: Annotate get_mem_config() functions as __init 2024-10-08 21:05:10 +02:00
ctrlmondata.c x86/resctrl: Avoid overflow in MB settings in bw_validate() 2024-10-08 16:17:38 +02:00
internal.h x86/resctrl: Enable shared RMID mode on Sub-NUMA Cluster (SNC) systems 2024-07-02 19:57:51 +02:00
Makefile
monitor.c - Enable Sub-NUMA clustering to work with resource control on Intel by 2024-07-16 10:53:54 -07:00
pseudo_lock.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
rdtgroup.c x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter 2024-07-02 19:57:19 +02:00
trace.h x86/resctrl: Add tracepoint for llc_occupancy tracking 2024-04-24 14:24:48 +02:00