Re: [PATCH v9 23/24] KVM: s390: arm64: Implement basic page fault handler
From: Lorenzo Stoakes (ARM)
Date: Thu Oct 01 2026 - 10:47:16 EST
On Thu, Oct 01, 2026 at 02:10:06PM +0200, Arnd Bergmann wrote:
> Hi Steffen,
>
> [Adding Lorenzo Stoakes to Cc]
>
> I see this function fails to build on top of linux-next, as the
> kvm_vcpu_dabt_is_cm() function was removed by commit 18b94675b1fb
> ("KVM: arm64: Use ESR helpers in guest abort handling").
>
> I used this patch to make it build, but I'm not sure if this is
> the correct fix:
>
> diff --git a/arch/s390/kvm/arm64/mmu.c b/arch/s390/kvm/arm64/mmu.c
> index 3c1c8a2def73..7ee157c61d70 100644
> --- a/arch/s390/kvm/arm64/mmu.c
> +++ b/arch/s390/kvm/arm64/mmu.c
> @@ -119,6 +119,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
> hva = gfn_to_hva_memslot_prot(memslot, gfn, &writable);
> write_fault = kvm_s390_cur_gmap_fault_is_write(vcpu);
> if (kvm_is_error_hva(hva) || (write_fault && !writable)) {
> + unsigned long esr = kvm_vcpu_get_esr(vcpu);
> ret = -ENOEXEC;
> /*
> * The guest has put either its instructions or its page-tables
> @@ -143,7 +144,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
> * Check for a cache maintenance operation. Assume the guest is
> * cautious and skip instruction
> */
> - if (kvm_is_error_hva(hva) && kvm_vcpu_dabt_is_cm(vcpu)) {
> + if (kvm_is_error_hva(hva) && esr_dabt_is_cm(esr)) {
> kvm_incr_pc(vcpu);
> ret = 1;
> goto out_unlock;
Thanks for the report!
The original function was:
static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)
{
return !!(kvm_vcpu_get_esr(vcpu) & ESR_ELx_CM);
}
And esr_dabt_is_cm() is:
static __always_inline bool esr_dabt_is_cm(unsigned long esr)
{
return esr & ESR_ELx_CM;
}
So looks good to me at a glance!
--
Cheers, Lorenzo