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