aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2019-01-09 15:03:23 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-02-04 18:44:18 +1100
commit1ac24c91bbfada5303a3d7ac1d50a05c489053a1 (patch)
treea7ceeb955c84bdfad8712060bb6302f7cac02403 /hw/ppc/spapr.c
parent4882206430532af27aa2ffd30df2818e4661e981 (diff)
downloadqemu-1ac24c91bbfada5303a3d7ac1d50a05c489053a1.zip
qemu-1ac24c91bbfada5303a3d7ac1d50a05c489053a1.tar.gz
qemu-1ac24c91bbfada5303a3d7ac1d50a05c489053a1.tar.bz2
hw/ppc/spapr: Encode the SCSI channel (bus) in the SRP LUNs
In hw/scsi/spapr_vio.c we declare that the controller supports multiple buses by specifying "max_channel = 7" there. So in the code that fixes up the device tree nodes, we must encode the channel number (a.k.a. bus number in the "Logical unit addressing format" table of SAM5) into the 64-bit LUN, too. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1663160 Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0942f35..71fe552 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2959,10 +2959,11 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
if (spapr) {
/*
* Replace "channel@0/disk@0,0" with "disk@8000000000000000":
- * We use SRP luns of the form 8000 | (bus << 8) | (id << 5) | lun
- * in the top 16 bits of the 64-bit LUN
+ * In the top 16 bits of the 64-bit LUN, we use SRP luns of the form
+ * 0x8000 | (target << 8) | (bus << 5) | lun
+ * (see the "Logical unit addressing format" table in SAM5)
*/
- unsigned id = 0x8000 | (d->id << 8) | d->lun;
+ unsigned id = 0x8000 | (d->id << 8) | (d->channel << 5) | d->lun;
return g_strdup_printf("%s@%"PRIX64, qdev_fw_name(dev),
(uint64_t)id << 48);
} else if (virtio) {