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

From: Arnd Bergmann

Date: Thu Oct 01 2026 - 08:27:33 EST



> + /*
> + * 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)) {
> + kvm_incr_pc(vcpu);
> + ret = 1;
> + goto out_unlock;

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;


Arnd