[PATCH v3 04/23] arm64: Prepare headers for sysreg sharing with s390
From: Steffen Eiden
Date: Fri Nov 06 2026 - 11:11:30 EST
Move the get-spectre-state functions to a convenient location. Guard
GICv5 headers away from s390 for arm_arch_timer.h.
No functional changes.
Co-developed-by: Andreas Grapentin <gra@xxxxxxxxxxxxx>
Signed-off-by: Andreas Grapentin <gra@xxxxxxxxxxxxx>
Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
---
arch/arm64/include/asm/spectre.h | 10 +++++-----
include/kvm/arm_arch_timer.h | 3 +++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/include/asm/spectre.h b/arch/arm64/include/asm/spectre.h
index 296ae3420bfd..2ecc9eddbebb 100644
--- a/arch/arm64/include/asm/spectre.h
+++ b/arch/arm64/include/asm/spectre.h
@@ -26,6 +26,11 @@ enum mitigation_state {
SPECTRE_VULNERABLE,
};
+enum mitigation_state arm64_get_spectre_v2_state(void);
+enum mitigation_state arm64_get_spectre_v4_state(void);
+enum mitigation_state arm64_get_meltdown_state(void);
+enum mitigation_state arm64_get_spectre_bhb_state(void);
+
struct pt_regs;
struct task_struct;
@@ -81,21 +86,16 @@ static __always_inline void arm64_apply_bp_hardening(void)
d->fn();
}
-enum mitigation_state arm64_get_spectre_v2_state(void);
bool has_spectre_v2(const struct arm64_cpu_capabilities *cap, int scope);
void spectre_v2_enable_mitigation(const struct arm64_cpu_capabilities *__unused);
bool has_spectre_v3a(const struct arm64_cpu_capabilities *cap, int scope);
void spectre_v3a_enable_mitigation(const struct arm64_cpu_capabilities *__unused);
-enum mitigation_state arm64_get_spectre_v4_state(void);
bool has_spectre_v4(const struct arm64_cpu_capabilities *cap, int scope);
void spectre_v4_enable_mitigation(const struct arm64_cpu_capabilities *__unused);
void spectre_v4_enable_task_mitigation(struct task_struct *tsk);
-enum mitigation_state arm64_get_meltdown_state(void);
-
-enum mitigation_state arm64_get_spectre_bhb_state(void);
bool is_spectre_bhb_affected(const struct arm64_cpu_capabilities *entry, int scope);
extern bool __nospectre_bhb;
u8 get_spectre_bhb_loop_value(void);
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index 80f96ea59f1a..dcffad87b88f 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -10,7 +10,10 @@
#include <linux/clocksource.h>
#include <linux/hrtimer.h>
+/* no GICv5 for s390 */
+#ifndef __s390__
#include <linux/irqchip/arm-gic-v5.h>
+#endif /* !__s390__ */
enum kvm_arch_timers {
TIMER_PTIMER,
--
2.56.0