Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: Make  _midr_in_range_list() an exported function

Subsequent patch will add target implementation CPU support and that
will require _midr_in_range_list() to access new data. To avoid
exporting the data make _midr_in_range_list() a normal function and
export it.

No functional changes intended.

Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20250221140229.12588-5-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

authored by

Shameer Kolothum and committed by
Oliver Upton
c8c2647e c0000e58

+17 -14
+1 -14
arch/arm64/include/asm/cputype.h
··· 276 276 return _model == model && rv >= rv_min && rv <= rv_max; 277 277 } 278 278 279 - static inline bool is_midr_in_range(struct midr_range const *range) 280 - { 281 - return midr_is_cpu_model_range(read_cpuid_id(), range->model, 282 - range->rv_min, range->rv_max); 283 - } 284 - 285 - static inline bool 286 - is_midr_in_range_list(struct midr_range const *ranges) 287 - { 288 - while (ranges->model) 289 - if (is_midr_in_range(ranges++)) 290 - return true; 291 - return false; 292 - } 279 + bool is_midr_in_range_list(struct midr_range const *ranges); 293 280 294 281 static inline u64 __attribute_const__ read_cpuid_mpidr(void) 295 282 {
+15
arch/arm64/kernel/cpu_errata.c
··· 14 14 #include <asm/kvm_asm.h> 15 15 #include <asm/smp_plat.h> 16 16 17 + static inline bool is_midr_in_range(struct midr_range const *range) 18 + { 19 + return midr_is_cpu_model_range(read_cpuid_id(), range->model, 20 + range->rv_min, range->rv_max); 21 + } 22 + 23 + bool is_midr_in_range_list(struct midr_range const *ranges) 24 + { 25 + while (ranges->model) 26 + if (is_midr_in_range(ranges++)) 27 + return true; 28 + return false; 29 + } 30 + EXPORT_SYMBOL_GPL(is_midr_in_range_list); 31 + 17 32 static bool __maybe_unused 18 33 __is_affected_midr_range(const struct arm64_cpu_capabilities *entry, 19 34 u32 midr, u32 revidr)
+1
arch/arm64/kernel/image-vars.h
··· 49 49 PROVIDE(__pi_arm64_use_ng_mappings = arm64_use_ng_mappings); 50 50 #ifdef CONFIG_CAVIUM_ERRATUM_27456 51 51 PROVIDE(__pi_cavium_erratum_27456_cpus = cavium_erratum_27456_cpus); 52 + PROVIDE(__pi_is_midr_in_range_list = is_midr_in_range_list); 52 53 #endif 53 54 PROVIDE(__pi__ctype = _ctype); 54 55 PROVIDE(__pi_memstart_offset_seed = memstart_offset_seed);