From nobody Thu May 2 16:48:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511163960525721.6749811913214; Sun, 19 Nov 2017 23:46:00 -0800 (PST) Received: from localhost ([::1]:55804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGglx-0007It-PW for importer@patchew.org; Mon, 20 Nov 2017 02:45:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGgl3-0006nt-FR for qemu-devel@nongnu.org; Mon, 20 Nov 2017 02:44:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGgl0-00064l-Ck for qemu-devel@nongnu.org; Mon, 20 Nov 2017 02:44:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34326) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGgl0-00064a-5v; Mon, 20 Nov 2017 02:44:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7CA580C0D; Mon, 20 Nov 2017 07:44:40 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id D02AF5D754; Mon, 20 Nov 2017 07:44:39 +0000 (UTC) From: Thomas Huth To: David Gibson , qemu-ppc@nongnu.org Date: Mon, 20 Nov 2017 08:44:38 +0100 Message-Id: <1511163878-11977-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 20 Nov 2017 07:44:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-2.11] hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" LUNs >=3D 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=3DSLOF.git;a=3Dcommitdiff;h=3Df72a37713fea47da (see https://bugzilla.redhat.com/show_bug.cgi?id=3D1431584 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 >=3D 256 in the right boot order. Fix it by using the bit to indicate the "flat space addressing method" for LUNs >=3D 256. Signed-off-by: Thomas Huth --- 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 =3D 0x1000000 | (d->id << 16) | d->lun; + if (d->lun >=3D 256) { + /* Use the LUN "flat space addressing method" */ + id |=3D 0x4000; + } return g_strdup_printf("%s@%"PRIX64, qdev_fw_name(dev), (uint64_t)id << 32); } else if (usb) { --=20 1.8.3.1