Re: [PATCH v4 06/25] arm64: Prepare headers for sysreg sharing with s390

From: Marc Zyngier

Date: Fri Dec 04 2026 - 04:01:23 EST


On Fri, 27 Nov 2026 14:22:09 +0000,
Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
>
> Move the get-spectre-state functions to a convenient location. Guard
> GICv5 headers away from s390 for arm_arch_timer.h.
>
> 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/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__ */

This really is the wrong way to do that. There is nothing in this file
that remotely requires GICv5 knowledge. If s390 can avoid it, so can
arm64.

So just get rid of it altogether, as this really looks like a leftover
from a reworked patch, and KVM/arm64 still compiles with the hack
below.

If in the future you face similar issues, do not add this sort of
ifdefs. Instead, figure out whether the include is actually necessary,
and if it really is, find a way to abstract it away.

M.

diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index 80f96ea59f1ae..6d8aa34ba78e7 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -10,8 +10,6 @@
#include <linux/clocksource.h>
#include <linux/hrtimer.h>

-#include <linux/irqchip/arm-gic-v5.h>
-
enum kvm_arch_timers {
TIMER_PTIMER,
TIMER_VTIMER,

--
Without deviation from the norm, progress is not possible.