yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390-bios-Add-channel-command-codes-structs-needed-f.patch

4ec855
From 81d722eaf6284d55e2da0ba6cc4874bfd262a7e2 Mon Sep 17 00:00:00 2001
4ec855
From: Thomas Huth <thuth@redhat.com>
4ec855
Date: Mon, 14 Oct 2019 10:06:43 +0100
4ec855
Subject: [PATCH 18/21] s390-bios: Add channel command codes/structs needed for
4ec855
 dasd-ipl
4ec855
4ec855
RH-Author: Thomas Huth <thuth@redhat.com>
4ec855
Message-id: <20191014100645.22862-16-thuth@redhat.com>
4ec855
Patchwork-id: 91792
4ec855
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH v2 15/17] s390-bios: Add channel command codes/structs needed for dasd-ipl
4ec855
Bugzilla: 1664376
4ec855
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
4ec855
RH-Acked-by: David Hildenbrand <david@redhat.com>
4ec855
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
4ec855
4ec855
From: "Jason J. Herne" <jjherne@linux.ibm.com>
4ec855
4ec855
The dasd IPL procedure needs to execute a few previously unused
4ec855
channel commands. Let's define them and their associated data
4ec855
structures.
4ec855
4ec855
Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
4ec855
Acked-by: Cornelia Huck <cohuck@redhat.com>
4ec855
Acked-by: Thomas Huth <thuth@redhat.com>
4ec855
Message-Id: <1554388475-18329-15-git-send-email-jjherne@linux.ibm.com>
4ec855
Signed-off-by: Thomas Huth <thuth@redhat.com>
4ec855
(cherry picked from commit 69333c36dc85b84b021766747cffc2b53df93ae8)
4ec855
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
---
4ec855
 pc-bios/s390-ccw/cio.h | 23 +++++++++++++++++++++++
4ec855
 1 file changed, 23 insertions(+)
4ec855
4ec855
diff --git a/pc-bios/s390-ccw/cio.h b/pc-bios/s390-ccw/cio.h
4ec855
index 1637e32..aaa432d 100644
4ec855
--- a/pc-bios/s390-ccw/cio.h
4ec855
+++ b/pc-bios/s390-ccw/cio.h
4ec855
@@ -200,11 +200,14 @@ typedef struct ccw1 {
4ec855
 #define CCW_FLAG_IDA             0x04
4ec855
 #define CCW_FLAG_SUSPEND         0x02
4ec855
 
4ec855
+/* Common CCW commands */
4ec855
+#define CCW_CMD_READ_IPL         0x02
4ec855
 #define CCW_CMD_NOOP             0x03
4ec855
 #define CCW_CMD_BASIC_SENSE      0x04
4ec855
 #define CCW_CMD_TIC              0x08
4ec855
 #define CCW_CMD_SENSE_ID         0xe4
4ec855
 
4ec855
+/* Virtio CCW commands */
4ec855
 #define CCW_CMD_SET_VQ           0x13
4ec855
 #define CCW_CMD_VDEV_RESET       0x33
4ec855
 #define CCW_CMD_READ_FEAT        0x12
4ec855
@@ -216,6 +219,12 @@ typedef struct ccw1 {
4ec855
 #define CCW_CMD_SET_CONF_IND     0x53
4ec855
 #define CCW_CMD_READ_VQ_CONF     0x32
4ec855
 
4ec855
+/* DASD CCW commands */
4ec855
+#define CCW_CMD_DASD_READ             0x06
4ec855
+#define CCW_CMD_DASD_SEEK             0x07
4ec855
+#define CCW_CMD_DASD_SEARCH_ID_EQ     0x31
4ec855
+#define CCW_CMD_DASD_READ_MT          0x86
4ec855
+
4ec855
 /*
4ec855
  * Command-mode operation request block
4ec855
  */
4ec855
@@ -333,6 +342,20 @@ typedef struct irb {
4ec855
     __u32 emw[8];
4ec855
 }  __attribute__ ((packed, aligned(4))) Irb;
4ec855
 
4ec855
+/* Used for SEEK ccw commands */
4ec855
+typedef struct CcwSeekData {
4ec855
+    uint16_t reserved;
4ec855
+    uint16_t cyl;
4ec855
+    uint16_t head;
4ec855
+} __attribute__((packed)) CcwSeekData;
4ec855
+
4ec855
+/* Used for SEARCH ID ccw commands */
4ec855
+typedef struct CcwSearchIdData {
4ec855
+    uint16_t cyl;
4ec855
+    uint16_t head;
4ec855
+    uint8_t record;
4ec855
+} __attribute__((packed)) CcwSearchIdData;
4ec855
+
4ec855
 int enable_mss_facility(void);
4ec855
 void enable_subchannel(SubChannelId schid);
4ec855
 uint16_t cu_type(SubChannelId schid);
4ec855
-- 
4ec855
1.8.3.1
4ec855