All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Andreas Grapentin <gra@linux.ibm.com>
Cc: Steffen Eiden <seiden@linux.ibm.com>,
	Oliver Upton <oupton@kernel.org>,
	Fuad Tabba <fuad.tabba@linux.dev>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Friedrich Welter <fritz@linux.ibm.com>,
	Gautam Gala <ggala@linux.ibm.com>,
	Hariharan Mari <hari55@linux.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Nico Boehr <nrb@linux.ibm.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Paolo Bonzini <pbonzini@redhat.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH 01/12] arm64: Prepare for sharing with s390
Date: Sat, 05 Dec 2026 18:34:39 +0000	[thread overview]
Message-ID: <87fqwbo9ts.wl-maz@kernel.org> (raw)
In-Reply-To: <axKh9IVloSuL1wbT@li-d8547bcc-2d90-11b2-a85c-a70f2a37009a.ibm.com>

On Fri, 04 Dec 2026 11:27:55 +0000,
Andreas Grapentin <gra@linux.ibm.com> wrote:
> 
> On Dec 04 26, Marc Zyngier wrote:
> > On Wed, 02 Dec 2026 14:11:39 +0000,
> > Steffen Eiden <seiden@linux.ibm.com> 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.

There seem to be a pretty simple solution to this conundrum, in the
form of a symbolic link. See the hack below, which allows me to build
the kvms390/sea branch without any __s390__ horror.

Or is there another set of nasty stuff lurking somewhere else?

Thanks,

	M.

From cf64943fbd34b626d748b1fd101dbaf872bd1bb9 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <maz@kernel.org>
Date: Sat, 5 Dec 2026 18:12:31 +0000
Subject: [PATCH] KVM: s390: arm64: Allow asm/foo.h directives in inherited
 arm64 code

Make sure that:

- arch/arm64/include/arm64 is in include path for code inherited
  from arm64

- asm/foo.h can be located in arch/arm64/include/arm64 by having
  an "asm" symlink pointing to that same directory

This ensures that any foo.h include file that has is present in
arch/arm64/include/arm64 can be reached using <asm/foo.h>, and
avoids other unsavoury methods.

Signed-off-by: Marc Zyngier <maz@kernel.org>
---
 arch/s390/include/arm64/asm  | 1 +
 arch/s390/kvm/arm64/Makefile | 1 +
 2 files changed, 2 insertions(+)
 create mode 120000 arch/s390/include/arm64/asm

diff --git a/arch/s390/include/arm64/asm b/arch/s390/include/arm64/asm
new file mode 120000
index 0000000000000..945c9b46d684f
--- /dev/null
+++ b/arch/s390/include/arm64/asm
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/arch/s390/kvm/arm64/Makefile b/arch/s390/kvm/arm64/Makefile
index e22037a7c498f..bfe3605d7cec3 100644
--- a/arch/s390/kvm/arm64/Makefile
+++ b/arch/s390/kvm/arm64/Makefile
@@ -7,6 +7,7 @@ include $(srctree)/virt/kvm/Makefile.kvm
 include $(srctree)/arch/$(SRCARCH)/kvm/gmap/Makefile
 include $(src)/Makefile.gen
 
+ccflags-y += -I$(srctree)/arch/$(SRCARCH)/include/arm64
 ccflags-y += -I $(src) -I $(objtree)/$(obj) -I$(srctree)/arch/$(SRCARCH)/kvm/gmap -DKVM_S390_ARM64
 
 kvm-arm64-local := \
-- 
2.47.3


-- 
Jazz isn't dead. It just smells funny.

  reply	other threads:[~2026-12-05 18:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 14:11 [PATCH 00/12] KVM: s390: arm64: SMCCC, timers and IRQ line Steffen Eiden
2026-12-02 14:11 ` [PATCH 01/12] arm64: Prepare for sharing with s390 Steffen Eiden
2026-12-04 11:15   ` Marc Zyngier
2026-12-04 11:27     ` Andreas Grapentin
2026-12-05 18:34       ` Marc Zyngier [this message]
2026-12-02 14:11 ` [PATCH 02/12] arm64: Share timer and smccc functionality " Steffen Eiden
2026-12-02 14:11 ` [PATCH 03/12] KVM: arm64: Share timer and smccc code " Steffen Eiden
2026-12-02 14:11 ` [PATCH 04/12] KVM: s390: arm64: Use register shadow helper Steffen Eiden
2026-12-02 14:11 ` [PATCH 05/12] KVM: s390: arm64: Shadow the guest timer CVAL registers Steffen Eiden
2026-12-02 14:11 ` [PATCH 06/12] KVM: s390: arm64: Use mpstate for guests Steffen Eiden
2026-12-02 14:11 ` [PATCH 07/12] KVM: s390: arm64: Enable full smccc support Steffen Eiden
2026-12-02 14:35   ` sashiko-bot
2026-12-02 14:11 ` [PATCH 08/12] KVM: s390: arm64: Report fwregs to userspace Steffen Eiden
2026-12-02 14:11 ` [PATCH 09/12] KVM: s390: arm64: Provide timer infrastructure Steffen Eiden
2026-12-02 14:26   ` sashiko-bot
2026-12-02 14:11 ` [PATCH 10/12] KVM: s390: arm64: Integrate guest timer Steffen Eiden
2026-12-02 14:34   ` sashiko-bot
2026-12-02 14:11 ` [PATCH 11/12] KVM: s390: arm64: Trap WFx Steffen Eiden
2026-12-02 14:11 ` [PATCH 12/12] KVM: s390: arm64: Add IRQ line Steffen Eiden
2026-12-02 14:54   ` sashiko-bot
2026-12-02 14:54 ` [PATCH 00/12] KVM: s390: arm64: SMCCC, timers and " sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fqwbo9ts.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=arnd@arndb.de \
    --cc=borntraeger@linux.ibm.com \
    --cc=brueckner@linux.ibm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=fritz@linux.ibm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=ggala@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=gra@linux.ibm.com \
    --cc=hari55@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=nrb@linux.ibm.com \
    --cc=oupton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=svens@linux.ibm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.