Skip to content

Commit f2d14bc

Browse files
evangreenpalmer-dabbelt
authored andcommitted
RISC-V: alternative: Remove feature_probe_func
Now that we're testing unaligned memory copy and making that determination generically, there are no more users of the vendor feature_probe_func(). While I think it's probably going to need to come back, there are no users right now, so let's remove it until it's needed. Signed-off-by: Evan Green <evan@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230818194136.4084400-3-evan@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 584ea65 commit f2d14bc

File tree

4 files changed

+0
-33
lines changed

4 files changed

+0
-33
lines changed

arch/riscv/errata/thead/errata.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,3 @@ void thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
120120
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
121121
local_flush_icache_all();
122122
}
123-
124-
void thead_feature_probe_func(unsigned int cpu,
125-
unsigned long archid,
126-
unsigned long impid)
127-
{
128-
if ((archid == 0) && (impid == 0))
129-
per_cpu(misaligned_access_speed, cpu) = RISCV_HWPROBE_MISALIGNED_FAST;
130-
}

arch/riscv/include/asm/alternative.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#define ALT_OLD_PTR(a) __ALT_PTR(a, old_offset)
3131
#define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
3232

33-
void probe_vendor_features(unsigned int cpu);
3433
void __init apply_boot_alternatives(void);
3534
void __init apply_early_boot_alternatives(void);
3635
void apply_module_alternatives(void *start, size_t length);
@@ -53,15 +52,11 @@ void thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
5352
unsigned long archid, unsigned long impid,
5453
unsigned int stage);
5554

56-
void thead_feature_probe_func(unsigned int cpu, unsigned long archid,
57-
unsigned long impid);
58-
5955
void riscv_cpufeature_patch_func(struct alt_entry *begin, struct alt_entry *end,
6056
unsigned int stage);
6157

6258
#else /* CONFIG_RISCV_ALTERNATIVE */
6359

64-
static inline void probe_vendor_features(unsigned int cpu) { }
6560
static inline void apply_boot_alternatives(void) { }
6661
static inline void apply_early_boot_alternatives(void) { }
6762
static inline void apply_module_alternatives(void *start, size_t length) { }

arch/riscv/kernel/alternative.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ struct cpu_manufacturer_info_t {
2727
void (*patch_func)(struct alt_entry *begin, struct alt_entry *end,
2828
unsigned long archid, unsigned long impid,
2929
unsigned int stage);
30-
void (*feature_probe_func)(unsigned int cpu, unsigned long archid,
31-
unsigned long impid);
3230
};
3331

3432
static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info)
@@ -43,7 +41,6 @@ static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info
4341
cpu_mfr_info->imp_id = sbi_get_mimpid();
4442
#endif
4543

46-
cpu_mfr_info->feature_probe_func = NULL;
4744
switch (cpu_mfr_info->vendor_id) {
4845
#ifdef CONFIG_ERRATA_SIFIVE
4946
case SIFIVE_VENDOR_ID:
@@ -53,7 +50,6 @@ static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info
5350
#ifdef CONFIG_ERRATA_THEAD
5451
case THEAD_VENDOR_ID:
5552
cpu_mfr_info->patch_func = thead_errata_patch_func;
56-
cpu_mfr_info->feature_probe_func = thead_feature_probe_func;
5753
break;
5854
#endif
5955
default:
@@ -143,20 +139,6 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
143139
}
144140
}
145141

146-
/* Called on each CPU as it starts */
147-
void probe_vendor_features(unsigned int cpu)
148-
{
149-
struct cpu_manufacturer_info_t cpu_mfr_info;
150-
151-
riscv_fill_cpu_mfr_info(&cpu_mfr_info);
152-
if (!cpu_mfr_info.feature_probe_func)
153-
return;
154-
155-
cpu_mfr_info.feature_probe_func(cpu,
156-
cpu_mfr_info.arch_id,
157-
cpu_mfr_info.imp_id);
158-
}
159-
160142
/*
161143
* This is called very early in the boot process (directly after we run
162144
* a feature detect on the boot CPU). No need to worry about other CPUs
@@ -211,7 +193,6 @@ void __init apply_boot_alternatives(void)
211193
/* If called on non-boot cpu things could go wrong */
212194
WARN_ON(smp_processor_id() != 0);
213195

214-
probe_vendor_features(0);
215196
_apply_alternatives((struct alt_entry *)__alt_start,
216197
(struct alt_entry *)__alt_end,
217198
RISCV_ALTERNATIVES_BOOT);

arch/riscv/kernel/smpboot.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ asmlinkage __visible void smp_callin(void)
247247
numa_add_cpu(curr_cpuid);
248248
set_cpu_online(curr_cpuid, 1);
249249
check_unaligned_access(curr_cpuid);
250-
probe_vendor_features(curr_cpuid);
251250

252251
if (has_vector()) {
253252
if (riscv_v_setup_vsize())

0 commit comments

Comments
 (0)