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

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