cryptospore / rpms / qemu-kvm

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