History

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.

Janis Schoetterl-Glausch committed 4 years ago

Commit e9e9fee1 parent c7ef9eb2 files · +26 −11Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+5−1
@@ -562,7 +562,10 @@ struct kvm_s390_mem_op { · 561 unmodified lines
562 __u32 op; /* type of operation */562 __u32 op; /* type of operation */
563 __u64 buf; /* buffer in userspace */563 __u64 buf; /* buffer in userspace */
564 union {564 union {
565 __u8 ar; /* the access register number */565 struct {
566 __u8 ar; /* the access register number */
567 __u8 key; /* access key, ignored if flag unset */
568 };
566 __u32 sida_offset; /* offset into the sida */569 __u32 sida_offset; /* offset into the sida */
567 __u8 reserved[32]; /* should be set to 0 */570 __u8 reserved[32]; /* should be set to 0 */
568 };571 };
@@ -575,6 +578,7 @@ struct kvm_s390_mem_op { · 6 unmodified lines
575/* flags for kvm_s390_mem_op->flags */578/* flags for kvm_s390_mem_op->flags */
576#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)579#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
577#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)580#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
581#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2)
578 582
579/* for KVM_INTERRUPT */583/* for KVM_INTERRUPT */
580struct kvm_interrupt {584struct kvm_interrupt {