thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
902636
From 1da0eecb9f2086c880fdaf1260ae775bbfbf5f02 Mon Sep 17 00:00:00 2001
902636
From: Cornelia Huck <cohuck@redhat.com>
902636
Date: Tue, 23 Jun 2020 09:25:37 -0400
902636
Subject: [PATCH 03/12] linux-headers: support vfio-ccw features
902636
902636
RH-Author: Cornelia Huck <cohuck@redhat.com>
902636
Message-id: <20200623092543.358315-4-cohuck@redhat.com>
902636
Patchwork-id: 97696
902636
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH 3/9] linux-headers: support vfio-ccw features
902636
Bugzilla: 1660916
902636
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
902636
RH-Acked-by: David Hildenbrand <david@redhat.com>
902636
RH-Acked-by: Thomas Huth <thuth@redhat.com>
902636
902636
Partial update to support CRW and SCHIB regions.
902636
902636
Upstream: n/a
902636
902636
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
902636
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
902636
---
902636
 linux-headers/linux/vfio.h     |  3 +++
902636
 linux-headers/linux/vfio_ccw.h | 19 +++++++++++++++++++
902636
 2 files changed, 22 insertions(+)
902636
902636
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
902636
index fb10370d29..9e227348b3 100644
902636
--- a/linux-headers/linux/vfio.h
902636
+++ b/linux-headers/linux/vfio.h
902636
@@ -378,6 +378,8 @@ struct vfio_region_gfx_edid {
902636
 
902636
 /* sub-types for VFIO_REGION_TYPE_CCW */
902636
 #define VFIO_REGION_SUBTYPE_CCW_ASYNC_CMD	(1)
902636
+#define VFIO_REGION_SUBTYPE_CCW_SCHIB		(2)
902636
+#define VFIO_REGION_SUBTYPE_CCW_CRW		(3)
902636
 
902636
 /*
902636
  * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
902636
@@ -577,6 +579,7 @@ enum {
902636
 
902636
 enum {
902636
 	VFIO_CCW_IO_IRQ_INDEX,
902636
+	VFIO_CCW_CRW_IRQ_INDEX,
902636
 	VFIO_CCW_NUM_IRQS
902636
 };
902636
 
902636
diff --git a/linux-headers/linux/vfio_ccw.h b/linux-headers/linux/vfio_ccw.h
902636
index fcc3e69ef5..6375d6ff25 100644
902636
--- a/linux-headers/linux/vfio_ccw.h
902636
+++ b/linux-headers/linux/vfio_ccw.h
902636
@@ -34,4 +34,23 @@ struct ccw_cmd_region {
902636
 	__u32 ret_code;
902636
 } __attribute__((packed));
902636
 
902636
+/*
902636
+ * Used for processing commands that read the subchannel-information block
902636
+ * Reading this region triggers a stsch() to hardware
902636
+ * Note: this is controlled by a capability
902636
+ */
902636
+struct ccw_schib_region {
902636
+#define SCHIB_AREA_SIZE 52
902636
+       __u8 schib_area[SCHIB_AREA_SIZE];
902636
+} __attribute__((packed));
902636
+
902636
+/*
902636
+ * Used for returning a Channel Report Word to userspace.
902636
+ * Note: this is controlled by a capability
902636
+ */
902636
+struct ccw_crw_region {
902636
+       __u32 crw;
902636
+       __u32 pad;
902636
+} __attribute__((packed));
902636
+
902636
 #endif
902636
-- 
902636
2.27.0
902636