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

Steffen Eiden seiden at linux.ibm.com
Thu Oct 1 07:03:36 PDT 2026


On Thu, Oct 01, 2026 at 02:10:06PM +0200, Arnd Bergmann wrote:
> 
> > +		/*
> > +		 * 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:
>
yes, it is the functional 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);
move this on top of the function. I need the esr in the function for the
full pfault handling later anyways.


>  		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;
> 

	Steffen



More information about the linux-arm-kernel mailing list