linux/arch/s390/kvm
Janis Schoetterl-Glausch b5d1274409 KVM: s390: Fix lockdep issue in vm memop
Issuing a memop on a protected vm does not make sense,
neither is the memory readable/writable, nor does it make sense to check
storage keys. This is why the ioctl will return -EINVAL when it detects
the vm to be protected. However, in order to ensure that the vm cannot
become protected during the memop, the kvm->lock would need to be taken
for the duration of the ioctl. This is also required because
kvm_s390_pv_is_protected asserts that the lock must be held.
Instead, don't try to prevent this. If user space enables secure
execution concurrently with a memop it must accecpt the possibility of
the memop failing.
Still check if the vm is currently protected, but without locking and
consider it a heuristic.

Fixes: ef11c9463a ("KVM: s390: Add vm IOCTL for key checked guest absolute memory access")
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220322153204.2637400-1-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2022-05-02 19:45:03 +02:00
..
diag.c KVM: s390: restore old debugfs names 2021-07-27 16:59:00 -04:00
gaccess.c KVM: s390: Add vm IOCTL for key checked guest absolute memory access 2022-02-14 16:12:57 +01:00
gaccess.h KVM: s390: Add vm IOCTL for key checked guest absolute memory access 2022-02-14 16:12:57 +01:00
guestdbg.c KVM: s390: Add memcg accounting to KVM allocations 2020-12-10 13:36:05 +01:00
intercept.c KVM: s390: Honor storage keys when accessing guest memory 2022-02-14 16:12:57 +01:00
interrupt.c KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused 2022-04-21 13:16:11 -04:00
irq.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Kconfig KVM: Use interval tree to do fast hva lookup in memslots 2021-12-08 04:24:32 -05:00
kvm-s390.c KVM: s390: Fix lockdep issue in vm memop 2022-05-02 19:45:03 +02:00
kvm-s390.h KVM: s390: Fix, test and feature for 5.18 part 2 2022-03-15 17:19:02 -04:00
Makefile KVM: s390: Use Makefile.kvm for common files 2021-12-09 12:58:33 -05:00
priv.c KVM: s390x: fix SCK locking 2022-03-14 16:12:27 +01:00
pv.c vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP 2022-04-19 12:08:57 -07:00
sigp.c KVM: s390: Clarify SIGP orders versus STOP/RESTART 2021-12-17 14:52:47 +01:00
trace-s390.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vsie.c KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused 2022-04-21 13:16:11 -04:00