cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
77c23f
From 9d1b94d3739567245578f30866facc13edb3be92 Mon Sep 17 00:00:00 2001
77c23f
From: Thomas Huth <thuth@redhat.com>
77c23f
Date: Fri, 29 May 2020 05:53:44 -0400
77c23f
Subject: [PATCH 02/42] linux-headers: update kvm.h
77c23f
77c23f
RH-Author: Thomas Huth <thuth@redhat.com>
77c23f
Message-id: <20200529055420.16855-3-thuth@redhat.com>
77c23f
Patchwork-id: 97020
77c23f
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH v2 02/38] linux-headers: update kvm.h
77c23f
Bugzilla: 1828317
77c23f
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
77c23f
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
77c23f
RH-Acked-by: David Hildenbrand <david@redhat.com>
77c23f
77c23f
Upstream-status: n/a
77c23f
77c23f
Update kvm.h for the upcoming new s390x reset and protected virtualization
77c23f
ioctls. This patch is based on commit ddda37483dd17c9936fdde9ebf8f6ca2692b3842
77c23f
and commit dc6f8d458a4ccc360723993f31d310d06469f55f, but I dropped all
77c23f
(unrequired) changes to the other linux-header files.
77c23f
77c23f
Signed-off-by: Thomas Huth <thuth@redhat.com>
77c23f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
77c23f
---
77c23f
 linux-headers/linux/kvm.h | 55 +++++++++++++++++++++++++++++++++++++--
77c23f
 1 file changed, 53 insertions(+), 2 deletions(-)
77c23f
77c23f
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
77c23f
index 3d9b18f7f8..578cd97c0d 100644
77c23f
--- a/linux-headers/linux/kvm.h
77c23f
+++ b/linux-headers/linux/kvm.h
77c23f
@@ -468,12 +468,17 @@ struct kvm_s390_mem_op {
77c23f
 	__u32 size;		/* amount of bytes */
77c23f
 	__u32 op;		/* type of operation */
77c23f
 	__u64 buf;		/* buffer in userspace */
77c23f
-	__u8 ar;		/* the access register number */
77c23f
-	__u8 reserved[31];	/* should be set to 0 */
77c23f
+	union {
77c23f
+		__u8 ar;	/* the access register number */
77c23f
+		__u32 sida_offset; /* offset into the sida */
77c23f
+		__u8 reserved[32]; /* should be set to 0 */
77c23f
+	};
77c23f
 };
77c23f
 /* types for kvm_s390_mem_op->op */
77c23f
 #define KVM_S390_MEMOP_LOGICAL_READ	0
77c23f
 #define KVM_S390_MEMOP_LOGICAL_WRITE	1
77c23f
+#define KVM_S390_MEMOP_SIDA_READ	2
77c23f
+#define KVM_S390_MEMOP_SIDA_WRITE	3
77c23f
 /* flags for kvm_s390_mem_op->flags */
77c23f
 #define KVM_S390_MEMOP_F_CHECK_ONLY		(1ULL << 0)
77c23f
 #define KVM_S390_MEMOP_F_INJECT_EXCEPTION	(1ULL << 1)
77c23f
@@ -1000,6 +1005,12 @@ struct kvm_ppc_resize_hpt {
77c23f
 #define KVM_CAP_PMU_EVENT_FILTER 173
77c23f
 #define KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174
77c23f
 #define KVM_CAP_HYPERV_DIRECT_TLBFLUSH 175
77c23f
+#define KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176
77c23f
+#define KVM_CAP_ARM_NISV_TO_USER 177
77c23f
+#define KVM_CAP_ARM_INJECT_EXT_DABT 178
77c23f
+#define KVM_CAP_S390_VCPU_RESETS 179
77c23f
+#define KVM_CAP_S390_PROTECTED 180
77c23f
+#define KVM_CAP_PPC_SECURE_GUEST 181
77c23f
 
77c23f
 #ifdef KVM_CAP_IRQ_ROUTING
77c23f
 
77c23f
@@ -1461,6 +1472,43 @@ struct kvm_enc_region {
77c23f
 /* Available with KVM_CAP_ARM_SVE */
77c23f
 #define KVM_ARM_VCPU_FINALIZE	  _IOW(KVMIO,  0xc2, int)
77c23f
 
77c23f
+/* Available with  KVM_CAP_S390_VCPU_RESETS */
77c23f
+#define KVM_S390_NORMAL_RESET	_IO(KVMIO,   0xc3)
77c23f
+#define KVM_S390_CLEAR_RESET	_IO(KVMIO,   0xc4)
77c23f
+
77c23f
+struct kvm_s390_pv_sec_parm {
77c23f
+	__u64 origin;
77c23f
+	__u64 length;
77c23f
+};
77c23f
+
77c23f
+struct kvm_s390_pv_unp {
77c23f
+	__u64 addr;
77c23f
+	__u64 size;
77c23f
+	__u64 tweak;
77c23f
+};
77c23f
+
77c23f
+enum pv_cmd_id {
77c23f
+	KVM_PV_ENABLE,
77c23f
+	KVM_PV_DISABLE,
77c23f
+	KVM_PV_SET_SEC_PARMS,
77c23f
+	KVM_PV_UNPACK,
77c23f
+	KVM_PV_VERIFY,
77c23f
+	KVM_PV_PREP_RESET,
77c23f
+	KVM_PV_UNSHARE_ALL,
77c23f
+};
77c23f
+
77c23f
+struct kvm_pv_cmd {
77c23f
+	__u32 cmd;	/* Command to be executed */
77c23f
+	__u16 rc;	/* Ultravisor return code */
77c23f
+	__u16 rrc;	/* Ultravisor return reason code */
77c23f
+	__u64 data;	/* Data or address */
77c23f
+	__u32 flags;    /* flags for future extensions. Must be 0 for now */
77c23f
+	__u32 reserved[3];
77c23f
+};
77c23f
+
77c23f
+/* Available with KVM_CAP_S390_PROTECTED */
77c23f
+#define KVM_S390_PV_COMMAND		_IOWR(KVMIO, 0xc5, struct kvm_pv_cmd)
77c23f
+
77c23f
 /* Secure Encrypted Virtualization command */
77c23f
 enum sev_cmd_id {
77c23f
 	/* Guest initialization commands */
77c23f
@@ -1611,4 +1659,7 @@ struct kvm_hyperv_eventfd {
77c23f
 #define KVM_HYPERV_CONN_ID_MASK		0x00ffffff
77c23f
 #define KVM_HYPERV_EVENTFD_DEASSIGN	(1 << 0)
77c23f
 
77c23f
+#define KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE    (1 << 0)
77c23f
+#define KVM_DIRTY_LOG_INITIALLY_SET            (1 << 1)
77c23f
+
77c23f
 #endif /* __LINUX_KVM_H */
77c23f
-- 
77c23f
2.27.0
77c23f