Re: [PATCH v6 28/33] KVM: s390: Add basic arm64 kvm module
From: Steffen Eiden
Date: Fri Aug 28 2026 - 12:05:11 EST
On Fri, Aug 28, 2026 at 01:33:00PM +0200, Janosch Frank wrote:
> On 8/12/26 5:36 PM, Steffen Eiden wrote:
> > Add basic code for the new arm64 on s390 KVM implementation.
> > Add kernel module boilerplate code and trivial functions.
> > Add tracing scaffolding.
> >
> > Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
> > ---
> > arch/s390/kvm/arm64/arm.c | 157 ++++++++++++++++++++++++++++++++++++
> > arch/s390/kvm/arm64/arm.h | 7 ++
> > arch/s390/kvm/arm64/guest.c | 92 +++++++++++++++++++++
> > arch/s390/kvm/arm64/trace.h | 18 +++++
> > 4 files changed, 274 insertions(+)
> > create mode 100644 arch/s390/kvm/arm64/arm.c
> > create mode 100644 arch/s390/kvm/arm64/arm.h
> > create mode 100644 arch/s390/kvm/arm64/guest.c
> > create mode 100644 arch/s390/kvm/arm64/trace.h
> >
> > diff --git a/arch/s390/kvm/arm64/arm.c b/arch/s390/kvm/arm64/arm.c
> > new file mode 100644
> > index 000000000000..8e17b7eef813
> > --- /dev/null
> > +++ b/arch/s390/kvm/arm64/arm.c
> > @@ -0,0 +1,157 @@
>
> [...]
>
> > +
> > +static u64 kvm_max_guest_address(void)
> > +{
> > + u64 max_addr;
> > +
> > + if (sclp.hamax == U64_MAX)
> > + max_addr = TASK_SIZE_MAX;
> > + else
> > + max_addr = min_t(u64, TASK_SIZE_MAX, sclp.hamax);
> > + return ALIGN_DOWN(max_addr + 1, 1 << 30) - 1;
> > +}
> We're sure that the MSLA + 1 - MSOA > MGPAS check aka VIR code 4 will never
> bite us? Or will you touch this up with the qmc support?
Series 2 with qmc support will in addition verify that the maximum guest
address is smaller or equal to MGPAS, which is calculated from the
PARange. MSO is always zero, so we should not run into this invalidity.
Steffen