Blame SOURCES/kvm-hw-ppc-spapr-Fix-virtio-scsi-bootindex-handling-for-.patch

4a2fec
From 8a285115ee19166f22024326063d330706639914 Mon Sep 17 00:00:00 2001
4a2fec
From: Thomas Huth <thuth@redhat.com>
4a2fec
Date: Thu, 23 Nov 2017 17:50:30 +0100
4a2fec
Subject: [PATCH 4/7] hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs
4a2fec
 >= 256
4a2fec
4a2fec
RH-Author: Thomas Huth <thuth@redhat.com>
4a2fec
Message-id: <1511459430-7395-2-git-send-email-thuth@redhat.com>
4a2fec
Patchwork-id: 77832
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH 1/1] hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256
4a2fec
Bugzilla: 1515393
4a2fec
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
4a2fec
4a2fec
LUNs >= 256 have to be encoded with the so-called "flat space
4a2fec
addressing method" for virtio-scsi, where an additional bit has to
4a2fec
be set. SLOF already took care of this with the following commit:
4a2fec
4a2fec
 https://git.qemu.org/?p=SLOF.git;a=commitdiff;h=f72a37713fea47da
4a2fec
 (see https://bugzilla.redhat.com/show_bug.cgi?id=1431584 for details)
4a2fec
4a2fec
But QEMU does not use this encoding yet for device tree paths
4a2fec
that have to be handed over to SLOF to deal with the "bootindex"
4a2fec
property, so SLOF currently fails to boot from virtio-scsi devices
4a2fec
with LUNs >= 256 in the right boot order. Fix it by using the bit
4a2fec
to indicate the "flat space addressing method" for LUNs >= 256.
4a2fec
4a2fec
Signed-off-by: Thomas Huth <thuth@redhat.com>
4a2fec
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
4a2fec
(cherry picked from commit bac658d1a4dc9dd637b2eb5006abda137071f17f)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 hw/ppc/spapr.c | 4 ++++
4a2fec
 1 file changed, 4 insertions(+)
4a2fec
4a2fec
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
4a2fec
index 96df3a7..2065f09 100644
4a2fec
--- a/hw/ppc/spapr.c
4a2fec
+++ b/hw/ppc/spapr.c
4a2fec
@@ -2628,6 +2628,10 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
4a2fec
              * swap 0100 or 10 << or 20 << ( target lun-id -- srplun )
4a2fec
              */
4a2fec
             unsigned id = 0x1000000 | (d->id << 16) | d->lun;
4a2fec
+            if (d->lun >= 256) {
4a2fec
+                /* Use the LUN "flat space addressing method" */
4a2fec
+                id |= 0x4000;
4a2fec
+            }
4a2fec
             return g_strdup_printf("%s@%"PRIX64, qdev_fw_name(dev),
4a2fec
                                    (uint64_t)id << 32);
4a2fec
         } else if (usb) {
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec