summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huth2017-11-20 08:44:38 +0100
committerDavid Gibson2017-11-22 05:28:37 +0100
commitbac658d1a4dc9dd637b2eb5006abda137071f17f (patch)
treeeb5e1642ca72b10affc4b3c45c67f25d5bf05b68
parentUpdate version for v2.11.0-rc2 release (diff)
downloadqemu-bac658d1a4dc9dd637b2eb5006abda137071f17f.tar.gz
qemu-bac658d1a4dc9dd637b2eb5006abda137071f17f.tar.xz
qemu-bac658d1a4dc9dd637b2eb5006abda137071f17f.zip
hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256
LUNs >= 256 have to be encoded with the so-called "flat space addressing method" for virtio-scsi, where an additional bit has to be set. SLOF already took care of this with the following commit: https://git.qemu.org/?p=SLOF.git;a=commitdiff;h=f72a37713fea47da (see https://bugzilla.redhat.com/show_bug.cgi?id=1431584 for details) But QEMU does not use this encoding yet for device tree paths that have to be handed over to SLOF to deal with the "bootindex" property, so SLOF currently fails to boot from virtio-scsi devices with LUNs >= 256 in the right boot order. Fix it by using the bit to indicate the "flat space addressing method" for LUNs >= 256. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--hw/ppc/spapr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 6285f7211f..4d0a84f3ec 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2663,6 +2663,10 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
* swap 0100 or 10 << or 20 << ( target lun-id -- srplun )
*/
unsigned id = 0x1000000 | (d->id << 16) | d->lun;
+ if (d->lun >= 256) {
+ /* Use the LUN "flat space addressing method" */
+ id |= 0x4000;
+ }
return g_strdup_printf("%s@%"PRIX64, qdev_fw_name(dev),
(uint64_t)id << 32);
} else if (usb) {