diff options
author | Janis Schoetterl-Glausch <scgl@linux.ibm.com> | 2022-02-11 19:22:10 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@linux.ibm.com> | 2022-02-14 16:12:57 +0100 |
commit | e9e9feebcbc14b174fef862842f8cc9a388e1db3 (patch) | |
tree | dee98779651470e6df4534688a926db761e7bd7e /include/uapi/linux/kvm.h | |
parent | c7ef9ebbed20b860f70cc7bece65622b570a8a93 (diff) | |
download | lwn-e9e9feebcbc14b174fef862842f8cc9a388e1db3.tar.gz lwn-e9e9feebcbc14b174fef862842f8cc9a388e1db3.zip |
KVM: s390: Add optional storage key checking to MEMOP IOCTL
User space needs a mechanism to perform key checked accesses when
emulating instructions.
The key can be passed as an additional argument.
Having an additional argument is flexible, as user space can
pass the guest PSW's key, in order to make an access the same way the
CPU would, or pass another key if necessary.
Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Link: https://lore.kernel.org/r/20220211182215.2730017-6-scgl@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Diffstat (limited to 'include/uapi/linux/kvm.h')
-rw-r--r-- | include/uapi/linux/kvm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 5191b57e1562..4566f429db2c 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -562,7 +562,10 @@ struct kvm_s390_mem_op { __u32 op; /* type of operation */ __u64 buf; /* buffer in userspace */ union { - __u8 ar; /* the access register number */ + struct { + __u8 ar; /* the access register number */ + __u8 key; /* access key, ignored if flag unset */ + }; __u32 sida_offset; /* offset into the sida */ __u8 reserved[32]; /* should be set to 0 */ }; @@ -575,6 +578,7 @@ struct kvm_s390_mem_op { /* flags for kvm_s390_mem_op->flags */ #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) +#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2) /* for KVM_INTERRUPT */ struct kvm_interrupt { |