mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
riscv: Annotate unaligned access init functions
Several functions used in unaligned access probing are only run at
init time. Annotate them appropriately.
Fixes: f413aae96c ("riscv: Set unaligned access speed at compile time")
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20250304120014.143628-11-ajones@ventanamicro.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
This commit is contained in:
parent
4701f33a10
commit
a00e022be5
|
|
@ -63,7 +63,7 @@ void __init riscv_user_isa_enable(void);
|
|||
#define __RISCV_ISA_EXT_SUPERSET_VALIDATE(_name, _id, _sub_exts, _validate) \
|
||||
_RISCV_ISA_EXT_DATA(_name, _id, _sub_exts, ARRAY_SIZE(_sub_exts), _validate)
|
||||
|
||||
bool check_unaligned_access_emulated_all_cpus(void);
|
||||
bool __init check_unaligned_access_emulated_all_cpus(void);
|
||||
#if defined(CONFIG_RISCV_SCALAR_MISALIGNED)
|
||||
void check_unaligned_access_emulated(struct work_struct *work __always_unused);
|
||||
void unaligned_emulation_finish(void);
|
||||
|
|
@ -76,7 +76,7 @@ static inline bool unaligned_ctl_available(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool check_vector_unaligned_access_emulated_all_cpus(void);
|
||||
bool __init check_vector_unaligned_access_emulated_all_cpus(void);
|
||||
#if defined(CONFIG_RISCV_VECTOR_MISALIGNED)
|
||||
void check_vector_unaligned_access_emulated(struct work_struct *work __always_unused);
|
||||
DECLARE_PER_CPU(long, vector_misaligned_access);
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ void check_vector_unaligned_access_emulated(struct work_struct *work __always_un
|
|||
kernel_vector_end();
|
||||
}
|
||||
|
||||
bool check_vector_unaligned_access_emulated_all_cpus(void)
|
||||
bool __init check_vector_unaligned_access_emulated_all_cpus(void)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
|
|
@ -625,7 +625,7 @@ bool check_vector_unaligned_access_emulated_all_cpus(void)
|
|||
return true;
|
||||
}
|
||||
#else
|
||||
bool check_vector_unaligned_access_emulated_all_cpus(void)
|
||||
bool __init check_vector_unaligned_access_emulated_all_cpus(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -659,7 +659,7 @@ void check_unaligned_access_emulated(struct work_struct *work __always_unused)
|
|||
}
|
||||
}
|
||||
|
||||
bool check_unaligned_access_emulated_all_cpus(void)
|
||||
bool __init check_unaligned_access_emulated_all_cpus(void)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
|
|
@ -684,7 +684,7 @@ bool unaligned_ctl_available(void)
|
|||
return unaligned_ctl;
|
||||
}
|
||||
#else
|
||||
bool check_unaligned_access_emulated_all_cpus(void)
|
||||
bool __init check_unaligned_access_emulated_all_cpus(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static int check_unaligned_access(void *param)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void check_unaligned_access_nonboot_cpu(void *param)
|
||||
static void __init check_unaligned_access_nonboot_cpu(void *param)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
struct page **pages = param;
|
||||
|
|
@ -175,7 +175,7 @@ static void set_unaligned_access_static_branches(void)
|
|||
modify_unaligned_access_branches(&fast_and_online, num_online_cpus());
|
||||
}
|
||||
|
||||
static int lock_and_set_unaligned_access_static_branch(void)
|
||||
static int __init lock_and_set_unaligned_access_static_branch(void)
|
||||
{
|
||||
cpus_read_lock();
|
||||
set_unaligned_access_static_branches();
|
||||
|
|
@ -218,7 +218,7 @@ static int riscv_offline_cpu(unsigned int cpu)
|
|||
}
|
||||
|
||||
/* Measure unaligned access speed on all CPUs present at boot in parallel. */
|
||||
static int check_unaligned_access_speed_all_cpus(void)
|
||||
static int __init check_unaligned_access_speed_all_cpus(void)
|
||||
{
|
||||
unsigned int cpu;
|
||||
unsigned int cpu_count = num_possible_cpus();
|
||||
|
|
@ -264,7 +264,7 @@ static int check_unaligned_access_speed_all_cpus(void)
|
|||
return 0;
|
||||
}
|
||||
#else /* CONFIG_RISCV_PROBE_UNALIGNED_ACCESS */
|
||||
static int check_unaligned_access_speed_all_cpus(void)
|
||||
static int __init check_unaligned_access_speed_all_cpus(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -379,7 +379,7 @@ static int riscv_online_cpu_vec(unsigned int cpu)
|
|||
}
|
||||
|
||||
/* Measure unaligned access speed on all CPUs present at boot in parallel. */
|
||||
static int vec_check_unaligned_access_speed_all_cpus(void *unused __always_unused)
|
||||
static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __always_unused)
|
||||
{
|
||||
schedule_on_each_cpu(check_vector_unaligned_access);
|
||||
|
||||
|
|
@ -393,13 +393,13 @@ static int vec_check_unaligned_access_speed_all_cpus(void *unused __always_unuse
|
|||
return 0;
|
||||
}
|
||||
#else /* CONFIG_RISCV_PROBE_VECTOR_UNALIGNED_ACCESS */
|
||||
static int vec_check_unaligned_access_speed_all_cpus(void *unused __always_unused)
|
||||
static int __init vec_check_unaligned_access_speed_all_cpus(void *unused __always_unused)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int check_unaligned_access_all_cpus(void)
|
||||
static int __init check_unaligned_access_all_cpus(void)
|
||||
{
|
||||
bool all_cpus_emulated, all_cpus_vec_unsupported;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user