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

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