Message ID | 20240421-arm32-cfi-v7-1-6e132a948cc8@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | CFI for ARM32 using LLVM | expand |
On Sun, Apr 21, 2024 at 11:28 AM Linus Walleij <linus.walleij@linaro.org> wrote: > > Instead of checking if cpu_check_bugs() exist, check for this > callback directly in the CPU vtable: this is better because the > function is just a define to the vtable entry and this is why > the code works. But we want to be able to specify a proper > function for cpu_check_bugs() so look into the vtable instead. > > In bugs.c assign PROC_VTABLE(switch_mm) instead of > assigning cpu_do_switch_mm where again this is just a define > into the vtable: this makes it possible to make > cpu_do_switch_mm() into a real function. Is this patch still needed? None of the remaining patches in this series define these as functions anymore. Sami
diff --git a/arch/arm/kernel/bugs.c b/arch/arm/kernel/bugs.c index 087bce6ec8e9..35d39efb51ed 100644 --- a/arch/arm/kernel/bugs.c +++ b/arch/arm/kernel/bugs.c @@ -7,7 +7,7 @@ void check_other_bugs(void) { #ifdef MULTI_CPU - if (cpu_check_bugs) + if (PROC_VTABLE(check_bugs)) cpu_check_bugs(); #endif } diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c index 8bc7a2d6d6c7..ea3ee2bd7b56 100644 --- a/arch/arm/mm/proc-v7-bugs.c +++ b/arch/arm/mm/proc-v7-bugs.c @@ -87,14 +87,14 @@ static unsigned int spectre_v2_install_workaround(unsigned int method) case SPECTRE_V2_METHOD_HVC: per_cpu(harden_branch_predictor_fn, cpu) = call_hvc_arch_workaround_1; - cpu_do_switch_mm = cpu_v7_hvc_switch_mm; + PROC_VTABLE(switch_mm) = cpu_v7_hvc_switch_mm; spectre_v2_method = "hypervisor"; break; case SPECTRE_V2_METHOD_SMC: per_cpu(harden_branch_predictor_fn, cpu) = call_smc_arch_workaround_1; - cpu_do_switch_mm = cpu_v7_smc_switch_mm; + PROC_VTABLE(switch_mm) = cpu_v7_smc_switch_mm; spectre_v2_method = "firmware"; break; }