linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: s390: Fix handle_sske page fault handling
@ 2021-10-22 11:29 Janis Schoetterl-Glausch
  2021-10-22 12:00 ` Christian Borntraeger
  2021-10-22 12:11 ` Claudio Imbrenda
  0 siblings, 2 replies; 4+ messages in thread
From: Janis Schoetterl-Glausch @ 2021-10-22 11:29 UTC (permalink / raw)
  To: Christian Borntraeger, Janosch Frank, Heiko Carstens, Vasily Gorbik
  Cc: Janis Schoetterl-Glausch, David Hildenbrand, Claudio Imbrenda,
	Alexander Gordeev, kvm, linux-s390, linux-kernel

Retry if fixup_user_fault succeeds.
The same issue in handle_pfmf was fixed by
a11bdb1a6b78 (KVM: s390: Fix pfmf and conditional skey emulation).

Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
---
 arch/s390/kvm/priv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 53da4ceb16a3..417154b314a6 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -397,6 +397,8 @@ static int handle_sske(struct kvm_vcpu *vcpu)
 		mmap_read_unlock(current->mm);
 		if (rc == -EFAULT)
 			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
+		if (rc == -EAGAIN)
+			continue;
 		if (rc < 0)
 			return rc;
 		start += PAGE_SIZE;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: s390: Fix handle_sske page fault handling
  2021-10-22 11:29 [PATCH] KVM: s390: Fix handle_sske page fault handling Janis Schoetterl-Glausch
@ 2021-10-22 12:00 ` Christian Borntraeger
       [not found]   ` <20211022152648.26536-1-scgl@linux.ibm.com>
  2021-10-22 12:11 ` Claudio Imbrenda
  1 sibling, 1 reply; 4+ messages in thread
From: Christian Borntraeger @ 2021-10-22 12:00 UTC (permalink / raw)
  To: Janis Schoetterl-Glausch, Janosch Frank, Heiko Carstens, Vasily Gorbik
  Cc: David Hildenbrand, Claudio Imbrenda, Alexander Gordeev, kvm,
	linux-s390, linux-kernel

Am 22.10.21 um 13:29 schrieb Janis Schoetterl-Glausch:
> Retry if fixup_user_fault succeeds.

Maybe rephrase that with a more verbose description (e.g. if fixup_user_fault succeeds
we return EAGAIN and thus we ust retry the loop and  blabla....)

> The same issue in handle_pfmf was fixed by
> a11bdb1a6b78 (KVM: s390: Fix pfmf and conditional skey emulation).
> 
> Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Patch itself looks good:

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>   arch/s390/kvm/priv.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
> index 53da4ceb16a3..417154b314a6 100644
> --- a/arch/s390/kvm/priv.c
> +++ b/arch/s390/kvm/priv.c
> @@ -397,6 +397,8 @@ static int handle_sske(struct kvm_vcpu *vcpu)
>   		mmap_read_unlock(current->mm);
>   		if (rc == -EFAULT)
>   			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
> +		if (rc == -EAGAIN)
> +			continue;
>   		if (rc < 0)
>   			return rc;
>   		start += PAGE_SIZE;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: s390: Fix handle_sske page fault handling
  2021-10-22 11:29 [PATCH] KVM: s390: Fix handle_sske page fault handling Janis Schoetterl-Glausch
  2021-10-22 12:00 ` Christian Borntraeger
@ 2021-10-22 12:11 ` Claudio Imbrenda
  1 sibling, 0 replies; 4+ messages in thread
From: Claudio Imbrenda @ 2021-10-22 12:11 UTC (permalink / raw)
  To: Janis Schoetterl-Glausch
  Cc: Christian Borntraeger, Janosch Frank, Heiko Carstens,
	Vasily Gorbik, David Hildenbrand, Alexander Gordeev, kvm,
	linux-s390, linux-kernel

On Fri, 22 Oct 2021 13:29:13 +0200
Janis Schoetterl-Glausch <scgl@linux.ibm.com> wrote:

> Retry if fixup_user_fault succeeds.
> The same issue in handle_pfmf was fixed by
> a11bdb1a6b78 (KVM: s390: Fix pfmf and conditional skey emulation).
> 
> Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>

with the description fixed as indicated by Christian:

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> ---
>  arch/s390/kvm/priv.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
> index 53da4ceb16a3..417154b314a6 100644
> --- a/arch/s390/kvm/priv.c
> +++ b/arch/s390/kvm/priv.c
> @@ -397,6 +397,8 @@ static int handle_sske(struct kvm_vcpu *vcpu)
>  		mmap_read_unlock(current->mm);
>  		if (rc == -EFAULT)
>  			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
> +		if (rc == -EAGAIN)
> +			continue;
>  		if (rc < 0)
>  			return rc;
>  		start += PAGE_SIZE;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] KVM: s390: Fix handle_sske page fault handling
       [not found]   ` <20211022152648.26536-1-scgl@linux.ibm.com>
@ 2021-10-25  7:08     ` Christian Borntraeger
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2021-10-25  7:08 UTC (permalink / raw)
  To: Janis Schoetterl-Glausch, Janosch Frank, Heiko Carstens, Vasily Gorbik
  Cc: David Hildenbrand, Claudio Imbrenda, Alexander Gordeev, kvm,
	linux-s390, linux-kernel

Am 22.10.21 um 17:26 schrieb Janis Schoetterl-Glausch:
> On Fri, Oct 22, 2021 at 02:00:13PM +0200, Christian Borntraeger wrote:
>> Am 22.10.21 um 13:29 schrieb Janis Schoetterl-Glausch:
>>> Retry if fixup_user_fault succeeds.
>>
>> Maybe rephrase that with a more verbose description (e.g. if fixup_user_fault succeeds
>> we return EAGAIN and thus we ust retry the loop and  blabla....)
>>
> Done
> 
> [...]
> -- >8 --
> Subject: [PATCH v2] KVM: s390: Fix handle_sske page fault handling
> 
> If handle_sske cannot set the storage key, because there is no
> page table entry or no present large page entry, it calls
> fixup_user_fault.
> However, currently, if the call succeeds, handle_sske returns
> -EAGAIN, without having set the storage key.
> Instead, retry by continue'ing the loop without incrementing the
> address.
> The same issue in handle_pfmf was fixed by
> a11bdb1a6b78 (KVM: s390: Fix pfmf and conditional skey emulation).
> 
> Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
>   arch/s390/kvm/priv.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
> index 53da4ceb16a3..417154b314a6 100644
> --- a/arch/s390/kvm/priv.c
> +++ b/arch/s390/kvm/priv.c
> @@ -397,6 +397,8 @@ static int handle_sske(struct kvm_vcpu *vcpu)
>   		mmap_read_unlock(current->mm);
>   		if (rc == -EFAULT)
>   			return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
> +		if (rc == -EAGAIN)
> +			continue;
>   		if (rc < 0)
>   			return rc;
>   		start += PAGE_SIZE;
> 

thanks applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-25  7:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 11:29 [PATCH] KVM: s390: Fix handle_sske page fault handling Janis Schoetterl-Glausch
2021-10-22 12:00 ` Christian Borntraeger
     [not found]   ` <20211022152648.26536-1-scgl@linux.ibm.com>
2021-10-25  7:08     ` Christian Borntraeger
2021-10-22 12:11 ` Claudio Imbrenda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).