From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.14186.1583156711075874871 for ; Mon, 02 Mar 2020 05:45:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h2GG9HH4; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583156710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MY3a3l+QdhlgUH9T5o7C15dtyXUm9Ks+MMlZwHaCvkY=; b=h2GG9HH4M63e9hCPEGWaDU/6ydSWG4p4bWYyqElgxfSnqKn0Vw891PotqKxfk85oV/5xLU N6kamQpbVta2csKEhURi6N+yeA8xKRmVRotU6WWUZGaP7tCh43mQOIDIYfXuLA8ko5lIlu RYrcbNgR1gmYupijyEpEMTk+3Csgp9I= 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-81-EpNQgKr5Ma6qZXF_v-ervQ-1; Mon, 02 Mar 2020 08:45:08 -0500 X-MC-Unique: EpNQgKr5Ma6qZXF_v-ervQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B76B113E5; Mon, 2 Mar 2020 13:45:07 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-197.ams2.redhat.com [10.36.117.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC2778D573; Mon, 2 Mar 2020 13:45:06 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 02/13] OvmfPkg: export abstract QEMU blob filesystem in standalone driver To: devel@edk2.groups.io, ard.biesheuvel@linaro.org References: <20200302072936.29221-1-ard.biesheuvel@linaro.org> <20200302072936.29221-3-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <783b39ff-f04a-4f46-32da-1f3cf1a80710@redhat.com> Date: Mon, 2 Mar 2020 14:45:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200302072936.29221-3-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/02/20 08:29, Ard Biesheuvel wrote: > Expose the existing implementation of an abstract filesystem exposing > the blobs passed to QEMU via the command line via a standalone DXE > driver. "git show --find-copies-harder" works wonders while reviewing this patch :) > > Notable difference with the original code is the switch to a new vendor > GUIDed media device path, as opposed to a vendor GUID hardware device > path, which is not entirely appropriate for pure software constructs. Good point! > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2566 > Signed-off-by: Ard Biesheuvel > --- > OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c | 979 ++++++++++++++++++++ > OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf | 48 + > 2 files changed, 1027 insertions(+) > > diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c > new file mode 100644 > index 000000000000..efecbd817da1 > --- /dev/null > +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c > @@ -0,0 +1,979 @@ > +/** @file > + DXE driver to expose the 'kernel', 'initrd' and 'cmdline' blobs > + provided by QEMU as file in an abstract file system (1) s/file/files/ [...] > diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf > new file mode 100644 > index 000000000000..f4b50c265027 > --- /dev/null > +++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.inf > @@ -0,0 +1,48 @@ > +## @file > +# DXE driver to expose the 'kernel', 'initrd' and 'cmdline' blobs > +# provided by QEMU as file in an abstract file system (2) same as (1) > +# > +# Copyright (C) 2014-2016, Red Hat, Inc. > +# Copyright (C) 2020, Arm, Limited. > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +## > + > +[Defines] > + INF_VERSION = 1.27 > + BASE_NAME = QemuKernelLoaderFsDxe > + FILE_GUID = 806040ca-dad9-4978-a3b4-2d2ab0c8a48f > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + ENTRY_POINT = QemuKernelLoaderFsDxeEntrypoint > + > +[Sources] > + QemuKernelLoaderFsDxe.c > + > +[Packages] > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + OvmfPkg/OvmfPkg.dec > + > +[LibraryClasses] > + BaseLib > + BaseMemoryLib > + DebugLib > + MemoryAllocationLib > + UefiBootServicesTableLib > + QemuFwCfgLib (3) slight disorder > + UefiDriverEntryPoint > + UefiRuntimeServicesTableLib > + > +[Guids] > + gEfiFileInfoGuid > + gEfiFileSystemInfoGuid > + gEfiFileSystemVolumeLabelInfoIdGuid > + gQemuKernelLoaderFsMediaGuid > + > +[Protocols] > + gEfiDevicePathProtocolGuid ## PRODUCES > + gEfiSimpleFileSystemProtocolGuid ## PRODUCES > + > +[Depex] > + gEfiRealTimeClockArchProtocolGuid > Good point about the depex; per PI vol 2, 12.6 Real Time Clock Architectural Protocol, we need this for gRT->GetTime(). The previous implementation can tage GetTime for granted, because it is linked into BdsDxe, which ensures that all the architectural protocols have been installed. (4) Can you please add a short note about this (the depex) in the commit message? With (1) to (4) addressed: Reviewed-by: Laszlo Ersek Thanks! Laszlo