aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2015-02-06 09:01:21 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-03-17 11:26:24 -0400
commit41408c28f283b49202ae374b1c42bc8e9b33a048 (patch)
tree4acd40bb4bacc760ad3c65c82b5604145d64d437 /include/uapi
parent664b4973537068402954bee6e2959b858f263a6f (diff)
KVM: s390: Add MEMOP ioctls for reading/writing guest memory
On s390, we've got to make sure to hold the IPTE lock while accessing logical memory. So let's add an ioctl for reading and writing logical memory to provide this feature for userspace, too. The maximum transfer size of this call is limited to 64kB to prevent that the guest can trigger huge copy_from/to_user transfers. QEMU currently only requests up to one or two pages so far, so 16*4kB seems to be a reasonable limit here. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/kvm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 82634a492fe0..0e16f2c9f0de 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -365,6 +365,24 @@ struct kvm_translation {
365 __u8 pad[5]; 365 __u8 pad[5];
366}; 366};
367 367
368/* for KVM_S390_MEM_OP */
369struct kvm_s390_mem_op {
370 /* in */
371 __u64 gaddr; /* the guest address */
372 __u64 flags; /* flags */
373 __u32 size; /* amount of bytes */
374 __u32 op; /* type of operation */
375 __u64 buf; /* buffer in userspace */
376 __u8 ar; /* the access register number */
377 __u8 reserved[31]; /* should be set to 0 */
378};
379/* types for kvm_s390_mem_op->op */
380#define KVM_S390_MEMOP_LOGICAL_READ 0
381#define KVM_S390_MEMOP_LOGICAL_WRITE 1
382/* flags for kvm_s390_mem_op->flags */
383#define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
384#define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
385
368/* for KVM_INTERRUPT */ 386/* for KVM_INTERRUPT */
369struct kvm_interrupt { 387struct kvm_interrupt {
370 /* in */ 388 /* in */
@@ -761,6 +779,7 @@ struct kvm_ppc_smmu_info {
761#define KVM_CAP_CHECK_EXTENSION_VM 105 779#define KVM_CAP_CHECK_EXTENSION_VM 105
762#define KVM_CAP_S390_USER_SIGP 106 780#define KVM_CAP_S390_USER_SIGP 106
763#define KVM_CAP_S390_VECTOR_REGISTERS 107 781#define KVM_CAP_S390_VECTOR_REGISTERS 107
782#define KVM_CAP_S390_MEM_OP 108
764 783
765#ifdef KVM_CAP_IRQ_ROUTING 784#ifdef KVM_CAP_IRQ_ROUTING
766 785
@@ -1136,6 +1155,8 @@ struct kvm_s390_ucas_mapping {
1136#define KVM_ARM_VCPU_INIT _IOW(KVMIO, 0xae, struct kvm_vcpu_init) 1155#define KVM_ARM_VCPU_INIT _IOW(KVMIO, 0xae, struct kvm_vcpu_init)
1137#define KVM_ARM_PREFERRED_TARGET _IOR(KVMIO, 0xaf, struct kvm_vcpu_init) 1156#define KVM_ARM_PREFERRED_TARGET _IOR(KVMIO, 0xaf, struct kvm_vcpu_init)
1138#define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list) 1157#define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list)
1158/* Available with KVM_CAP_S390_MEM_OP */
1159#define KVM_S390_MEM_OP _IOW(KVMIO, 0xb1, struct kvm_s390_mem_op)
1139 1160
1140#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 1161#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
1141#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) 1162#define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)