From nobody Wed Nov 5 17:50:38 2025 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.zoho.com; dkim=fail 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496718224015703.4764673044101; Mon, 5 Jun 2017 20:03:44 -0700 (PDT) Received: from localhost ([::1]:36001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4mU-0006pK-EV for importer@patchew.org; Mon, 05 Jun 2017 23:03:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dI4b1-0003YV-3F for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dI4az-00031A-Bs for qemu-devel@nongnu.org; Mon, 05 Jun 2017 22:51:51 -0400 Received: from ozlabs.org ([103.22.144.67]:45725) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dI4ay-0002zc-Up; Mon, 05 Jun 2017 22:51:49 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3whbmr3cmrz9sDb; Tue, 6 Jun 2017 12:51:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1496717500; bh=pFKKT/pg+t/NCQDu1atl2cUDYOcurODr9UA0uyKzQgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AQnsjexqUxyK8A/dzeqhlY74VS2kbKHThIqUKMlFW5Yw04E6xkiHt9W5y5+EHJRiY 3OwcxrBKW0dbmaGXNrpIyaY0WdXEbpRUxFFpnjtV/pwtw+dE/Lyot2cpe9eY9hyvhZ 3k+SGE+jVwA87WQR9NYYHN6D4EDIaiyXwBr6Nwog= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 6 Jun 2017 12:51:29 +1000 Message-Id: <20170606025135.2685-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606025135.2685-1-david@gibson.dropbear.id.au> References: <20170606025135.2685-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends 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: Mike Cui , qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, Felipe Franciosi , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Felipe Franciosi The current implementation of spapr_get_fw_dev_path() doesn't take into consideration vhost-*-scsi devices. This makes said devices unbootable on PPC as SLOF is unable to work out the path to scan boot disks. This makes VMs bootable on spapr when using vhost-*-scsi by implementing a disk path for VHostSCSICommon (which currently includes both vhost-user-scsi and vhost-scsi). Signed-off-by: Felipe Franciosi Signed-off-by: Mike Cui Signed-off-by: David Gibson --- hw/ppc/spapr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5d10366..c1c0951 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -57,6 +57,7 @@ #include "hw/pci/pci.h" #include "hw/scsi/scsi.h" #include "hw/virtio/virtio-scsi.h" +#include "hw/virtio/vhost-scsi-common.h" =20 #include "exec/address-spaces.h" #include "hw/usb.h" @@ -2384,6 +2385,7 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p,= BusState *bus, ((type *)object_dynamic_cast(OBJECT(obj), (name))) SCSIDevice *d =3D CAST(SCSIDevice, dev, TYPE_SCSI_DEVICE); sPAPRPHBState *phb =3D CAST(sPAPRPHBState, dev, TYPE_SPAPR_PCI_HOST_BR= IDGE); + VHostSCSICommon *vsc =3D CAST(VHostSCSICommon, dev, TYPE_VHOST_SCSI_CO= MMON); =20 if (d) { void *spapr =3D CAST(void, bus->parent, "spapr-vscsi"); @@ -2440,6 +2442,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p= , BusState *bus, return g_strdup_printf("pci@%"PRIX64, phb->buid); } =20 + if (vsc) { + /* Same logic as virtio above */ + unsigned id =3D 0x1000000 | (vsc->target << 16) | vsc->lun; + return g_strdup_printf("disk@%"PRIX64, (uint64_t)id << 32); + } + return NULL; } =20 --=20 2.9.4