]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: pv: avoid stalls when making pages secure
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 20 Sep 2021 13:24:52 +0000 (15:24 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 25 Oct 2021 07:20:39 +0000 (09:20 +0200)
commitcb0fb437d80af65a0a8d3bf1ffca87ccab0c5d0a
tree3e7603404c56abc27670b823b223c2e1d5435118
parent0f01af088c0a1e9d4b965ede3004b05d501412e1
KVM: s390: pv: avoid stalls when making pages secure

Improve make_secure_pte to avoid stalls when the system is heavily
overcommitted. This was especially problematic in kvm_s390_pv_unpack,
because of the loop over all pages that needed unpacking.

Due to the locks being held, it was not possible to simply replace
uv_call with uv_call_sched. A more complex approach was
needed, in which uv_call is replaced with __uv_call, which does not
loop. When the UVC needs to be executed again, -EAGAIN is returned, and
the caller (or its caller) will try again.

When -EAGAIN is returned, the path is the same as when the page is in
writeback (and the writeback check is also performed, which is
harmless).

Fixes: a92898e4d7ed12 ("s390/mm: provide memory management functions for protected KVM guests")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Link: https://lore.kernel.org/r/20210920132502.36111-5-imbrenda@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kernel/uv.c
arch/s390/kvm/intercept.c