]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
KVM: s390: Fix handle_sske page fault handling
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Fri, 22 Oct 2021 15:26:48 +0000 (17:26 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 13 Jan 2022 17:42:26 +0000 (18:42 +0100)
BugLink: https://bugs.launchpad.net/bugs/1953387
[ Upstream commit 85f517b29418158d3e6e90c3f0fc01b306d2f1a1 ]

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>
Link: https://lore.kernel.org/r/20211022152648.26536-1-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/s390/kvm/priv.c

index 8938936424150569eb1bcd78ce1fa0e54e1eacec..af68b8b7319466b4467777710df58f39ad0c5e31 100644 (file)
@@ -398,6 +398,8 @@ static int handle_sske(struct kvm_vcpu *vcpu)
                up_read(&current->mm->mmap_sem);
                if (rc == -EFAULT)
                        return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
+               if (rc == -EAGAIN)
+                       continue;
                if (rc < 0)
                        return rc;
                start += PAGE_SIZE;