Re: [PATCH v1 4/7] KVM: s390: Fix fault-in code
From: Steffen Eiden
Date: Thu May 28 2026 - 10:16:04 EST
On Thu, May 28, 2026 at 01:47:24PM +0200, Claudio Imbrenda wrote:
> Fix the fault-in code so that it does not return success if a
> concurrent unmap event invalidated the fault-in process between the
> best-effort lockless check and the proper check with lock.
>
> The new behaviour is to retry, like the best-effort lockless check
> already did.
>
> This prevents the fault-in handler from returning success without
> having actually faulted in the requested page.
>
One nit below.
Reviewed-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
> Fixes: e907ae530133 ("KVM: s390: Add helper functions for fault handling")
> Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> ---
> arch/s390/kvm/faultin.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/arch/s390/kvm/faultin.c b/arch/s390/kvm/faultin.c
> index ddf0ca71f374..3047dfdc8be4 100644
> --- a/arch/s390/kvm/faultin.c
> +++ b/arch/s390/kvm/faultin.c
> @@ -36,7 +36,7 @@ int kvm_s390_faultin_gfn(struct kvm_vcpu *vcpu, struct kvm *kvm, struct guest_fa
> struct kvm_s390_mmu_cache *mc = NULL;
> struct kvm_memory_slot *slot;
> unsigned long inv_seq;
> - int foll, rc = 0;
> + int foll, rc = -EAGAIN;
This is not in reverse Christmas tree anymore.
Split them into two lines.
...
Steffen