From: David Gibson <david@gibson.dropbear.id.au>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.11] hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256
Date: Tue, 21 Nov 2017 11:12:26 +1100 [thread overview]
Message-ID: <20171121001226.GN19214@umbus.fritz.box> (raw)
In-Reply-To: <1511163878-11977-1-git-send-email-thuth@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]
On Mon, Nov 20, 2017 at 08:44:38AM +0100, Thomas Huth wrote:
> 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>
Applied to ppc-for-2.11, thanks.
> ---
> hw/ppc/spapr.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index d682f01..ff2eec4 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2643,6 +2643,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) {
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2017-11-21 0:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 7:44 [Qemu-devel] [PATCH for-2.11] hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256 Thomas Huth
2017-11-21 0:12 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171121001226.GN19214@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).