]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: Add vm IOCTL for key checked guest absolute memory access
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>
Fri, 11 Feb 2022 18:22:11 +0000 (19:22 +0100)
committerChristian Borntraeger <borntraeger@linux.ibm.com>
Mon, 14 Feb 2022 15:12:57 +0000 (16:12 +0100)
commit4f43b1a785ce5d2e5df5ad1a56299f9e0aa8acb3
treef66d7612d89db533e084b43ff939ede784f64732
parent67e23204fed216f1d59b8fe59d6bd67ddee9a9b2
KVM: s390: Add vm IOCTL for key checked guest absolute memory access

Channel I/O honors storage keys and is performed on absolute memory.
For I/O emulation user space therefore needs to be able to do key
checked accesses.
The vm IOCTL supports read/write accesses, as well as checking
if an access would succeed.
Unlike relying on KVM_S390_GET_SKEYS for key checking would,
the vm IOCTL performs the check in lockstep with the read or write,
by, ultimately, mapping the access to move instructions that
support key protection checking with a supplied key.
Fetch and storage protection override are not applicable to absolute
accesses and so are not applied as they are when using the vcpu memop.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Link: https://lore.kernel.org/r/20220211182215.ce6bbc0-7-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
arch/s390/kvm/gaccess.c
arch/s390/kvm/gaccess.h
arch/s390/kvm/kvm-s390.c
include/uapi/linux/kvm.h