From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2029520945BF9 for ; Thu, 14 Sep 2017 14:59:33 -0700 (PDT) Received: by mail-io0-x233.google.com with SMTP id n69so4110146ioi.5 for ; Thu, 14 Sep 2017 15:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fWyrLi+LV3qGACzLzL3fhuH3L1isqMGw5vnAK0Q90sw=; b=fXXZ/cMg7fK7SjjnL+qDm/gBa91Ocuj6DWFr2lk13qwjAjbEivdu503PoSWIb795LY KWikmyp+omd4AH9JgYzvu4B8bg4bp93s/t5Gcc3g1b+Dt/uvnzXIwXelBVGeBYs1HkGO kdHGkYA+rC961Y487xxYAaKUCXxWOA/5xoOLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fWyrLi+LV3qGACzLzL3fhuH3L1isqMGw5vnAK0Q90sw=; b=Gmrs8RHJfv9jbfAuJ9ROMmH1+Osh3LGAG6IxY7MjOX5Rv9ZkSZL0VCSNgGJWnDWbkV 7mcsMdauH7T9mPI//A/9gxIZ5vIrAEF8XAcmgYsUk7UDoxeU7BZYyjWGFEe+YKRqpzy9 RwjOBpQUHaYJe6sAiGdEGVSkvDK9KgKJW7dknRyjMxOMGpRxrwuxfGVNaoouGlzz1bCb Pg+ki0LHCb6BLbOCsjLSS0qqtMNttruIw+O1rzTUGWmzYP9WEH062QIXrDsP9tfa0qwn MJE/Mbs4R4WSuAUvRmShc6PyI14AouqOTgWXpD+2h9gPO1zb1g762/q5wMem1eztTJRq aN8A== X-Gm-Message-State: AHPjjUjDx4p+Yc3RG22/T6YNnBy081CsBNqZxWDLjJ0kGEXnSQDKXYhn ZP9axtr+WNFqd9L0pDm8nIzaqJRjK3U31EuZPgpi6w== X-Google-Smtp-Source: AOwi7QBZ2LVZqMYei3+XLQJSY65gm5AyZoE6ioVBJNX0rbuL/7G3rK8oH5geF6vCNcTdfoVqEbWiuWrAs7r09KGGdUo= X-Received: by 10.107.154.71 with SMTP id c68mr5241337ioe.95.1505426551864; Thu, 14 Sep 2017 15:02:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.152.18 with HTTP; Thu, 14 Sep 2017 15:02:31 -0700 (PDT) In-Reply-To: <20170914153734.13572-2-lersek@redhat.com> References: <20170914153734.13572-1-lersek@redhat.com> <20170914153734.13572-2-lersek@redhat.com> From: Ard Biesheuvel Date: Thu, 14 Sep 2017 15:02:31 -0700 Message-ID: To: Laszlo Ersek Cc: edk2-devel-01 , Gerd Hoffmann , Jordan Justen Subject: Re: [PATCH 1/1] OvmfPkg/QemuBootOrderLib: recognize "usb-storage" devices in XHCI ports X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 21:59:33 -0000 Content-Type: text/plain; charset="UTF-8" On 14 September 2017 at 08:37, Laszlo Ersek wrote: > The feature is primarily useful for modern AARCH64 guests that have no > built-in virtio block / SCSI drivers; as on "qemu-system-aarch64 -M virt", > there are no IDE or AHCI controllers that could be used as fallback. XHCI > is available in "-M virt" however, and because XHCI predates AARCH64 by > several years, said guests are expected to have built-in drivers for it. > > Other device models ("usb-uas", "usb-bot") are out of scope for now, > similarly to USB1.x (UHCI) and USB2 (EHCI) host controllers, and similarly > to USB hubs (which are USB1.1 only). In particular, port mapping between > EHCI and companion UHCI controllers is very complex; it even leads to PCI > slot/function differences between the OpenFirmware device paths exported > by QEMU and the the UEFI device paths generated by edk2. > > The number of ports on the XHCI controller defaults to 4, but it can be > raised via the "p3" property to 15. In addition, several XHCI controllers > can be grouped into a single-slot, multi-function PCI device. These allow > for a good number of usb-storage devices, while their desired boot order > remains recognizable to this patch. > > In the example below, we create two XHCI controllers, grouped into PCI > slot 00:02 as functions 0 and 1. Both controllers are given 15 ports. We > attach a "usb-storage" device to controller 1 at port 3 (ports are 1-based > in QEMU, 0-based in edk2), and attach another "usb-storage" device to > controller 2 at port 9. > > QEMU command line options (NB. they apply equally to aarch64/virt and > x86_64/{i440fx,q35}): > > -device qemu-xhci,id=xhci1,p3=15,addr=02.0,multifunction=on \ > -device qemu-xhci,id=xhci2,p3=15,addr=02.1 \ > \ > -drive id=disk1,if=none,format=qcow2,$DISK1_OPTIONS \ > -drive id=disk2,if=none,format=qcow2,$DISK2_OPTIONS \ > \ > -device usb-storage,drive=disk1,bus=xhci1.0,port=3,bootindex=1 \ > -device usb-storage,drive=disk2,bus=xhci2.0,port=9,bootindex=2 \ > > Libvirt domain XML fragment: > > >
domain='0x0000' bus='0x00' slot='0x02' function='0x0' > multifunction='on'/> > > >
domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> > > > > > > > >
> > > > > > >
> > > Cc: Ard Biesheuvel > Cc: Gerd Hoffmann > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Acked-by: Ard Biesheuvel