KVM: s390: Fix handle_sske page fault handling
PATCH 1/1 KVM: s390: Fix handle_sske page fault handling
Retry if fixup_user_fault succeeds.
The same issue in handle_pfmf was fixed bya11bdb1a6b78 (KVM: s390: Fix pfmf and conditional skey emulation).
--- arch/s390/kvm/priv.c | 2 ++ 1 file changed, 2 insertions(+)
arch/s390/kvm/priv.c +2 -0
@@ -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 ;
Signature · 1 line
2.25.1
Am 22.10.21 um 13:29 schrieb Janis Schoetterl-Glausch:
Quoted 1 line
Retry if
fixup_user_faultsucceeds.
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....)
Quoted 5 lines
The same issue in
handle_pfmfwas fixed bya11bdb1a6b78(KVM: s390: Fix pfmf and conditional skey emulation).Fixes bd096f644319 ("KVM: s390: Add skey emulation fault handling")Signed-off-by Janis Schoetterl-Glausch <[email protected]>
Patch itself looks good:
Quoted 18 lines
--- arch/s390/kvm/priv.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/kvm/priv.c +2
-0@@ -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 ;
A message that is not in the archive (sent off-list or not yet received): [email protected]
Christian Borntraeger
AppliedAm 22.10.21 um 17:26 schrieb Janis Schoetterl-Glausch:
Quoted 37 lines · Christian Borntraeger
Quoted 6 lines
Am 22.10.21 um 13:29 schrieb Janis Schoetterl-Glausch:
Quoted 1 line
Retry if
fixup_user_faultsucceeds.Maybe rephrase that with a more verbose description (e.g. if
fixup_user_faultsucceeds we return EAGAIN and thus we ust retry the loop and blabla....)Done
[...]
-- >8 --
Subject: [PATCH v2] KVM: s390: Fixhandle_sskepage fault handlingIf
handle_sskecannot set the storage key, because there is no page table entry or no present large page entry, it callsfixup_user_fault.
However, currently, if the call succeeds,handle_sskereturns-EAGAIN, without having set the storage key.
Instead, retry by continue'ing the loop without incrementing the address.
The same issue inhandle_pfmfwas fixed bya11bdb1a6b78(KVM: s390: Fix pfmf and conditional skey emulation).Fixes bd096f644319 ("KVM: s390: Add skey emulation fault handling")Signed-off-by Janis Schoetterl-Glausch <[email protected]>Reviewed-by Christian Borntraeger <[email protected]>Reviewed-by Claudio Imbrenda <[email protected]>--- arch/s390/kvm/priv.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/kvm/priv.c +0
-0
arch/s390/kvm/priv.c static int handle_sske(struct kvm_vcpu *vcpu) · line 404
Quoted 8 lines
arch/s390/kvm/priv.c +2
-0@@ -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.
Quoted 6 lines · On Fri, 22 Oct 2021 13:29:13 +0200 Janis Schoetterl-Glausch…
Retry if
fixup_user_faultsucceeds.
The same issue inhandle_pfmfwas fixed bya11bdb1a6b78(KVM: s390: Fix pfmf and conditional skey emulation).Fixes bd096f644319 ("KVM: s390: Add skey emulation fault handling")Signed-off-by Janis Schoetterl-Glausch <[email protected]>
with the description fixed as indicated by Christian:
Quoted 17 lines
--- arch/s390/kvm/priv.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/kvm/priv.c +2
-0@@ -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 ;