Skip to content

Commit bd334c8

Browse files
babumogerbp3tk0v
authored andcommitted
x86/resctrl: Add __init attribute to rdt_get_mon_l3_config()
In an upcoming change, rdt_get_mon_l3_config() needs to call rdt_cpu_has() to query the monitor related features. It cannot be called right now because rdt_cpu_has() has the __init attribute but rdt_get_mon_l3_config() doesn't. Add the __init attribute to rdt_get_mon_l3_config() that is only called by get_rdt_mon_resources() that already has the __init attribute. Also make rdt_cpu_has() available to by rdt_get_mon_l3_config() via the internal header file. Signed-off-by: Babu Moger <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov (AMD) <[email protected]>
1 parent 5b6fac3 commit bd334c8

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static int __init set_rdt_options(char *str)
728728
}
729729
__setup("rdt", set_rdt_options);
730730

731-
static bool __init rdt_cpu_has(int flag)
731+
bool __init rdt_cpu_has(int flag)
732732
{
733733
bool ret = boot_cpu_has(flag);
734734
struct rdt_options *o;

arch/x86/kernel/cpu/resctrl/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ void closid_free(int closid);
512512
int alloc_rmid(void);
513513
void free_rmid(u32 rmid);
514514
int rdt_get_mon_l3_config(struct rdt_resource *r);
515+
bool __init rdt_cpu_has(int flag);
515516
void mon_event_count(void *info);
516517
int rdtgroup_mondata_show(struct seq_file *m, void *arg);
517518
void mon_event_read(struct rmid_read *rr, struct rdt_resource *r,

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static void l3_mon_evt_init(struct rdt_resource *r)
763763
list_add_tail(&mbm_local_event.list, &r->evt_list);
764764
}
765765

766-
int rdt_get_mon_l3_config(struct rdt_resource *r)
766+
int __init rdt_get_mon_l3_config(struct rdt_resource *r)
767767
{
768768
unsigned int mbm_offset = boot_cpu_data.x86_cache_mbm_width_offset;
769769
struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);

0 commit comments

Comments
 (0)