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.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -562,7 +562,10 @@ struct kvm_s390_mem_op { · 561 unmodified lines | ||
| 562 | 562 | __u32 op; /* type of operation */ |
| 563 | 563 | __u64 buf; /* buffer in userspace */ |
| 564 | 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 | 569 | __u32 sida_offset; /* offset into the sida */ |
| 567 | 570 | __u8 reserved[32]; /* should be set to 0 */ |
| 568 | 571 | }; |
| @@ -575,6 +578,7 @@ struct kvm_s390_mem_op { · 6 unmodified lines | ||
| 575 | 578 | /* flags for kvm_s390_mem_op->flags */ |
| 576 | 579 | #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) |
| 577 | 580 | #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) |
| 581 | +#define KVM_S390_MEMOP_F_SKEY_PROTECTION (1ULL << 2) | |
| 578 | 582 | |
| 579 | 583 | /* for KVM_INTERRUPT */ |
| 580 | 584 | struct kvm_interrupt { |