[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/7] pc-bios/s390-ccw: handle more ECKD DASD block s
From: |
Jens Freimann |
Subject: |
[Qemu-devel] [PATCH 2/7] pc-bios/s390-ccw: handle more ECKD DASD block sizes |
Date: |
Fri, 29 Aug 2014 11:01:37 +0200 |
From: "Eugene (jno) Dvurechenski" <address@hidden>
Using dasdfmt(8) to format a DASD allows to choose a block size.
There are four supported values: 512, 1024, 2048, and 4096 bytes
per block. Each block size leads to selection of new count of
sectors per track. The head count remains always the same: 15.
This empiric knowledge is used to detect ECKD DASD to IPL from.
Signed-off-by: Eugene (jno) Dvurechenski <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Jens Freimann <address@hidden>
---
pc-bios/s390-ccw/virtio.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 04977e4..6ed3dc9 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -299,14 +299,35 @@ bool virtio_disk_is_scsi(void)
&& (virtio_get_block_size() == 512);
}
+/*
+ * Other supported value pairs, if any, would need to be added here.
+ * Note: head count is always 15.
+ */
+static inline u8 virtio_eckd_sectors_for_block_size(int size)
+{
+ switch (size) {
+ case 512:
+ return 49;
+ case 1024:
+ return 33;
+ case 2048:
+ return 21;
+ case 4096:
+ return 12;
+ }
+ return 0;
+}
+
bool virtio_disk_is_eckd(void)
{
+ const int block_size = virtio_get_block_size();
+
if (guessed_disk_nature) {
- return (virtio_get_block_size() == 4096);
+ return (block_size == 4096);
}
return (blk_cfg.geometry.heads == 15)
- && (blk_cfg.geometry.sectors == 12)
- && (virtio_get_block_size() == 4096);
+ && (blk_cfg.geometry.sectors ==
+ virtio_eckd_sectors_for_block_size(block_size));
}
bool virtio_ipl_disk_is_valid(void)
--
1.8.5.5
- [Qemu-devel] [PATCH 0/7] s390-ccw.img: block size and DASD format support, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 3/7] pc-bios/s390-ccw Improve ECKD informational message, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 4/7] pc-bios/s390-ccw Really big EAV ECKD DASD handling, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 2/7] pc-bios/s390-ccw: handle more ECKD DASD block sizes,
Jens Freimann <=
- [Qemu-devel] [PATCH 5/7] pc-bios/s390-ccw: IPL from DASD with format variations, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 6/7] pc-bios/s390-ccw: Do proper console setup, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 1/7] pc-bios/s390-ccw: support all virtio block size, Jens Freimann, 2014/08/29
- [Qemu-devel] [PATCH 7/7] pc-bios/s390-ccw.img binary update, Jens Freimann, 2014/08/29
- Re: [Qemu-devel] [PATCH 0/7] s390-ccw.img: block size and DASD format support, Christian Borntraeger, 2014/08/29