thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 6 months ago
Clone

Blame SOURCES/kvm-pc-bios-s390-ccw-virtio-blkdev-Remove-virtio_assume_.patch

29b115
From d3335a98a7b6e084aadf4907968536a67cf8e64c Mon Sep 17 00:00:00 2001
29b115
From: Thomas Huth <thuth@redhat.com>
29b115
Date: Fri, 8 Jul 2022 20:49:01 +0200
29b115
Subject: [PATCH 09/17] pc-bios/s390-ccw/virtio-blkdev: Remove
29b115
 virtio_assume_scsi()
29b115
29b115
RH-Author: Thomas Huth <thuth@redhat.com>
29b115
RH-MergeRequest: 106: pc-bios/s390-ccw: Fix boot from disks with 4k sectors that do not have the typical DASD geometry
29b115
RH-Commit: [4/10] bf27f75344f220a03475a2918ed49ec9cd5ba317 (thuth/qemu-kvm-cs9)
29b115
RH-Bugzilla: 2098077
29b115
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
29b115
RH-Acked-by: David Hildenbrand <david@redhat.com>
29b115
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
29b115
29b115
Bugzilla: http://bugzilla.redhat.com/2098077
29b115
29b115
commit 5447de2619050a0a4dd480b97f88a9b58da360d1
29b115
Author: Thomas Huth <thuth@redhat.com>
29b115
Date:   Mon Jul 4 13:18:56 2022 +0200
29b115
29b115
    pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi()
29b115
29b115
    The virtio_assume_scsi() function is very questionable: First, it
29b115
    is only called for virtio-blk, and not for virtio-scsi, so the naming
29b115
    is already quite confusing. Second, it is called if we detected a
29b115
    "invalid" IPL disk, trying to fix it by blindly setting a sector
29b115
    size of 512. This of course won't work in most cases since disks
29b115
    might have a different sector size for a reason.
29b115
29b115
    Thus let's remove this strange function now. The calling code can
29b115
    also be removed completely, since there is another spot in main.c
29b115
    that does "IPL_assert(virtio_ipl_disk_is_valid(), ...)" to make
29b115
    sure that we do not try to IPL from an invalid device.
29b115
29b115
    Message-Id: <20220704111903.62400-6-thuth@redhat.com>
29b115
    Reviewed-by: Eric Farman <farman@linux.ibm.com>
29b115
    Signed-off-by: Thomas Huth <thuth@redhat.com>
29b115
29b115
Signed-off-by: Thomas Huth <thuth@redhat.com>
29b115
---
29b115
 pc-bios/s390-ccw/virtio-blkdev.c | 24 ------------------------
29b115
 pc-bios/s390-ccw/virtio.h        |  1 -
29b115
 2 files changed, 25 deletions(-)
29b115
29b115
diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c
29b115
index 7e13155589..db1f7f44aa 100644
29b115
--- a/pc-bios/s390-ccw/virtio-blkdev.c
29b115
+++ b/pc-bios/s390-ccw/virtio-blkdev.c
29b115
@@ -112,23 +112,6 @@ VirtioGDN virtio_guessed_disk_nature(void)
29b115
     return virtio_get_device()->guessed_disk_nature;
29b115
 }
29b115
 
29b115
-void virtio_assume_scsi(void)
29b115
-{
29b115
-    VDev *vdev = virtio_get_device();
29b115
-
29b115
-    switch (vdev->senseid.cu_model) {
29b115
-    case VIRTIO_ID_BLOCK:
29b115
-        vdev->guessed_disk_nature = VIRTIO_GDN_SCSI;
29b115
-        vdev->config.blk.blk_size = VIRTIO_SCSI_BLOCK_SIZE;
29b115
-        vdev->config.blk.physical_block_exp = 0;
29b115
-        vdev->blk_factor = 1;
29b115
-        break;
29b115
-    case VIRTIO_ID_SCSI:
29b115
-        vdev->scsi_block_size = VIRTIO_SCSI_BLOCK_SIZE;
29b115
-        break;
29b115
-    }
29b115
-}
29b115
-
29b115
 void virtio_assume_iso9660(void)
29b115
 {
29b115
     VDev *vdev = virtio_get_device();
29b115
@@ -247,13 +230,6 @@ int virtio_blk_setup_device(SubChannelId schid)
29b115
     switch (vdev->senseid.cu_model) {
29b115
     case VIRTIO_ID_BLOCK:
29b115
         sclp_print("Using virtio-blk.\n");
29b115
-        if (!virtio_ipl_disk_is_valid()) {
29b115
-            /* make sure all getters but blocksize return 0 for
29b115
-             * invalid IPL disk
29b115
-             */
29b115
-            memset(&vdev->config.blk, 0, sizeof(vdev->config.blk));
29b115
-            virtio_assume_scsi();
29b115
-        }
29b115
         break;
29b115
     case VIRTIO_ID_SCSI:
29b115
         IPL_assert(vdev->config.scsi.sense_size == VIRTIO_SCSI_SENSE_SIZE,
29b115
diff --git a/pc-bios/s390-ccw/virtio.h b/pc-bios/s390-ccw/virtio.h
29b115
index 241730effe..600ba5052b 100644
29b115
--- a/pc-bios/s390-ccw/virtio.h
29b115
+++ b/pc-bios/s390-ccw/virtio.h
29b115
@@ -182,7 +182,6 @@ enum guessed_disk_nature_type {
29b115
 typedef enum guessed_disk_nature_type VirtioGDN;
29b115
 
29b115
 VirtioGDN virtio_guessed_disk_nature(void);
29b115
-void virtio_assume_scsi(void);
29b115
 void virtio_assume_eckd(void);
29b115
 void virtio_assume_iso9660(void);
29b115
 
29b115
-- 
29b115
2.31.1
29b115