[PATCH v9 23/24] KVM: s390: arm64: Implement basic page fault handler

Steffen Eiden seiden at linux.ibm.com
Thu Oct 1 08:30:05 PDT 2026


On Thu, Oct 01, 2026 at 03:36:26PM +0100, Lorenzo Stoakes (ARM) wrote:
> On Thu, Oct 01, 2026 at 03:35:37PM +0200, Arnd Bergmann wrote:
> > Another ones: after 34cfa9b3af17 ("KVM: arm64: Implement
> > KVM_PRE_FAULT_MEMORY"), we are now missing a kvm_arch_pre_fault_allowed()
> > definition in arch/s390/kvm/arm64/mmu.c:
> >
> > ERROR: modpost: arch/s390/kvm/arm64/kvm-arm64.ko: symbol 'kvm_arch_pre_fault_allowed' undefined!
> >
> > I copied the arm64 version without the pkvm reference to make it
> > build for me.
> >
> >      Arnd
> >
> > diff --git a/arch/s390/kvm/arm64/mmu.c b/arch/s390/kvm/arm64/mmu.c
> > index 7ee157c61d70..be16351acaae 100644
> > --- a/arch/s390/kvm/arm64/mmu.c
> > +++ b/arch/s390/kvm/arm64/mmu.c
> > @@ -179,6 +179,14 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
> >  	return ret;
> >  }
> >
> > +int kvm_arch_pre_fault_allowed(struct kvm_vcpu *vcpu)
> > +{
> > +	if (!kvm_vcpu_initialized(vcpu))
> > +		return -ENOEXEC;
> > +
> > +	return 0;
> > +}
> > +
thanks. This must have slipped through somehow.


> 
> Ah the s390 <-> kvm emulation stuff.

no, its not emulation :) 
We use a hardware based acclearaion approach.


> 
> Yep if it's meant to behave like arm64 then that should be correct.
> 
> It's odd to me that pre-faulting was not previously implemented for actual-arm64
> but was added as part of the virtualised s390/arm64 thing automatically :)
> 
> Not sure if this implementation requires what s390 does with:
> 
> +int kvm_arch_pre_fault_allowed(struct kvm_vcpu *vcpu)
> +{
> +       if (kvm_is_ucontrol(vcpu->kvm))
> +               return -EINVAL;
no, ucontrol is a feature only for native s390 guests.
kvm_arm64 on s390 always evaluates kvm_is_ucontrol() to false if it
appears in shared (between both s390 KVMs) code.

> +
> +       return 0;
> +}
> 
> Or both conditions? One for the s390 guys.
> 
so just the initialized test.

thanks

	Steffen



More information about the linux-arm-kernel mailing list