thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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