From bbd75db9784e2c3e484dc41507fc25cd29398844 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 13 Jun 2023 12:38:49 +0900 Subject: [PATCH] ODROID: Fix compile error. This commit occur compile errors. "arm64: Mitigate spectre style branch history side channels" Change-Id: I4b39dc25b4974827f347fa3633ad4343d5f5dd2c --- arch/arm64/include/asm/assembler.h | 2 ++ arch/arm64/kernel/cpu_errata.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index cb0f24bd31bc..305b607eda3b 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -512,7 +512,9 @@ alternative_endif .macro __mitigate_spectre_bhb_loop tmp #ifdef CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY +#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR alternative_cb spectre_bhb_patch_loop_iter +#endif mov \tmp, #32 // Patched to correct the immediate alternative_cb_end .Lspectre_bhb_loop\@: diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c index ae364d6b37ac..3b97ad7d6b08 100644 --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -562,7 +562,9 @@ const struct arm64_cpu_capabilities arm64_errata[] = { .capability = ARM64_SPECTRE_BHB, .matches = is_spectre_bhb_affected, #ifdef CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY +#ifdef CONFIG_HARDEN_BRANCH_PREDICTOR .cpu_enable = spectre_bhb_enable_mitigation, +#endif #endif }, {