From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.35588.1612793665493905564 for ; Mon, 08 Feb 2021 06:14:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FBoEPVgS; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612793664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IeG4My/VPm79OxLOQ5hSHZ8KOlQBg+I8szNZghqncYY=; b=FBoEPVgSpiRAkzzersdLTRKm2p/QpNWmHzuy+UJriH1Kb5FK5TR3J3CcDefXgL78Q+Jj/j cHZWlZ+16FtyTd6SApvcDtJc/YYsox5WSoaRFV8x3l8OIL+sauaeScWVOXWhs1+Oa0OzQ1 0bH29jvTmIX61g+jFnMZSu9jSttG6yU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-cUDzJOHLOyWs71iPLC6r2w-1; Mon, 08 Feb 2021 09:14:20 -0500 X-MC-Unique: cUDzJOHLOyWs71iPLC6r2w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3ED7801962; Mon, 8 Feb 2021 14:14:19 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-172.ams2.redhat.com [10.36.115.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA1C35C1D0; Mon, 8 Feb 2021 14:14:18 +0000 (UTC) Subject: Re: [edk2-devel] Does EDK2 ArmVirtPkg has support for a virtio-mmio-blk device To: devel@edk2.groups.io, fangying7@yeah.net References: From: "Laszlo Ersek" Cc: "Ard Biesheuvel (TianoCore)" Message-ID: <9534eb95-4167-566a-a825-a97b2e11ce68@redhat.com> Date: Mon, 8 Feb 2021 15:14:17 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit (Adding Ard, just in case -- the topic is set by the first quoted question below) On 02/08/21 04:24, Ying Fang wrote: > Hi, Does anybody know whether the EDK2 ArmVirtPkg has support for a virtio-mmio-device ? virtio-mmio is a virtio transport type, not a particular device. (1) ArmVirtPkg + OvmfPkg support the following three virtio transports: (1a) Virtio PCI, virtio spec version 0.9.5, [OvmfPkg/VirtioPciDeviceDxe] (1b) Virtio PCI, virtio spec version 1.0, [OvmfPkg/Virtio10Dxe] (1c) Virtio MMIO, virtio spec version 0.9.5 *only* [ArmVirtPkg/VirtioFdtDxe] [OvmfPkg/Library/VirtioMmioDeviceLib] (2) Additionally, OvmfPkg offers the following virtio device drivers: - VirtioBlkDxe - VirtioFsDxe [1.0 only] - VirtioGpuDxe [1.0 only] - VirtioNetDxe - VirtioRngDxe - VirtioScsiDxe (2a) The drivers marked "1.0 only" will only work on top of the transport mentioned in point (1b). Put differently, they will only drive the following virtio-1.0 QEMU device models: - VirtioFsDxe: "vhost-user-fs-pci" - VirtioGpuDxe: "virtio-gpu-pci" (2b) The drivers *not* marked "1.0 only" will work on top of *either* virtio transport that's noted in (1a), (1b), (1c). This implies that, using the ArmVirtQemu firmware platform, you can use the following QEMU device models *too*: - VirtioBlkDxe: "virtio-blk-device" - VirtioNetDxe: "virtio-net-device" - VirtioRngDxe: "virtio-rng-device" - VirtioScsiDxe: "virtio-scsi-device" > I am using EDK2 ArmVirtPkg v2.70 as the default UEFI for my devel program. A commit hash would be more useful (not sure if it matters for now, but in case it does, a commit hash is best). > Since we have not implemented the PCI/PCIe suff, a virtio-mmio-blk device is used as the image disk. There is no such device model ("virtio-mmio-blk") in QEMU, as far as I can tell. Do you mean "virtio-blk-device"? > We can boot the EDK2 ArmVirtPkg into UEFI shell, and the Mapping table message shows > > Mapping table: > BLK0: Alias(s): > VenHw(xxx, 00) Do you have an EFI system partition on the virtio block device? Because, the "map" UEFI shell command (executed automatically at shell startup) should list such a filesystem as "FS0:" here. > However when I chose the “Boot From File” menu item, I can not see the virtio-mmio-blk device. That's not surprising, minimally because the MAP command above does not list "FS0:". > So does anybody know whether the EDK2 ArmVirtPkg has support for a virtio-mmio-device ? The virtio-blk-device is supported, yes, using the virtio-mmio (0.9.5) transport type. But in order to actually boot from the device, you need more things. Such as: - an EFI system partition / FAT filesystem on the device, - bootable UEFI binaries (matching the guest architecture), - a correctly populated "bootorder" fw_cfg file, so that the UEFI boot order be updated as well. This "bootorder" fw_cfg file is created by QEMU upon use of the "bootindex" device properties, and it is acted upon by the following components: ArmVirtPkg/Library/PlatformBootManagerLib OvmfPkg/Library/QemuBootOrderLib Thanks Laszlo