Re: [PATCH 01/12] arm64: Prepare for sharing with s390
From: Andreas Grapentin
Date: Fri Dec 04 2026 - 06:29:04 EST
On Dec 04 26, Marc Zyngier wrote:
> On Wed, 02 Dec 2026 14:11:39 +0000,
> Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:
> >
> > Add s390 guards for arm headers which reside in include/kvm. This allows
> > s390 to use headers placed in its arch include/arm64/ .
>
> As I said in my reply to another patch, this isn't an acceptable
> outcome. If you are taking the full include file, you take it all,
> without s390 stuff in it.
>
> > diff --git a/include/kvm/arm_hypercalls.h b/include/kvm/arm_hypercalls.h
> > index 2df152207ccd..5ce4c2d43f9a 100644
> > --- a/include/kvm/arm_hypercalls.h
> > +++ b/include/kvm/arm_hypercalls.h
> > @@ -4,7 +4,10 @@
> > #ifndef __KVM_ARM_HYPERCALLS_H
> > #define __KVM_ARM_HYPERCALLS_H>
> >
> > +/* s390 provides its own header view */
> > +#ifndef __s390__
> > #include <asm/kvm_emulate.h>
> > +#endif // !__s390__
> >
> > int kvm_smccc_call_handler(struct kvm_vcpu *vcpu);
>
> The real question really is: why can't this directly target your own
> version of kvm_emulate.h? My hunch is that the problem is in the
> generated path:
>
> $ find . -name kvm_emulate.h | grep arm64
> ./arch/s390/include/arm64/kvm_emulate.h
> ./arch/arm64/include/asm/kvm_emulate.h
>
> Shouldn't the s390 path be arch/s390/include/arm64/asm/kvm_emulate.h
> so that <asm/kvm_emulate.h> reaches the correct file?
We tried this initially, but there were examples where a header with the
path ./arch/s390/include/asm/foo.h already exists, which would shadow
the generated header during compile time.
We tried to solve this with a bunch of unholy trickery in the include
paths, but in the end we settled for rewriting all the asm/ includes to
arm64/ during processing of the shared headers to separate the
namespaces cleanly.
The fallout of this decision is that actually verbatim shared headers
now disagree in their view of the include path.
Best,
-A