public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
To: Laszlo Ersek <lersek@redhat.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH v2 04/14] OvmfPkg: provide a generic implementation of QemuLoadImageLib
Date: Thu, 5 Mar 2020 12:37:46 +0100	[thread overview]
Message-ID: <CAKv+Gu81MDhhFLJPcW2CqyWD1XpqGa0Cvm_rxGCWEf6XjKrKCw@mail.gmail.com> (raw)
In-Reply-To: <6c1d2510-7714-9eb7-c99e-bc5f59b411ac@redhat.com>

On Thu, 5 Mar 2020 at 12:29, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 03/05/20 10:51, Laszlo Ersek wrote:
> > On 03/04/20 10:52, Ard Biesheuvel wrote:
> >> Implement QemuLoadImageLib, and make it load the image provided by the
> >> QEMU_EFI_LOADER_FS_MEDIA_GUID/kernel device path that we implemented
> >> in a preceding patch in a separate DXE driver, using only the standard
> >> LoadImage and StartImage boot services.
> >>
> >> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2566
> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> ---
> >>  OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c   | 278 ++++++++++++++++++++
> >>  OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf |  38 +++
> >>  2 files changed, 316 insertions(+)
> >
> > Reviewed-by: Laszlo Ersek <lersek@redhat.com>
>
> One request though:
>
> >
> >> diff --git a/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c
> >> new file mode 100644
> >> index 000000000000..f5edb43cc0b9
> >> --- /dev/null
> >> +++ b/OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.c
> >> @@ -0,0 +1,278 @@
> >> +/**  @file
> >> +  Generic implementation of QemuLoadImageLib library class interface.
> >> +
> >> +  Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
> >> +
> >> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >> +**/
> >> +
> >> +#include <Uefi.h>
> >> +
> >> +#include <Base.h>
> >> +#include <Guid/QemuKernelLoaderFsMedia.h>
> >> +#include <Library/DebugLib.h>
> >> +#include <Library/MemoryAllocationLib.h>
> >> +#include <Library/PrintLib.h>
> >> +#include <Library/QemuFwCfgLib.h>
> >> +#include <Library/QemuLoadImageLib.h>
> >> +#include <Library/UefiBootServicesTableLib.h>
> >> +#include <Protocol/DevicePath.h>
> >> +#include <Protocol/LoadedImage.h>
> >> +
> >> +#pragma pack (1)
> >> +typedef struct {
> >> +  EFI_DEVICE_PATH_PROTOCOL  FilePathHeader;
> >> +  CHAR16                    FilePath[ARRAY_SIZE (L"kernel")];
> >> +} KERNEL_FILE_DEVPATH;
> >> +
> >> +typedef struct {
> >> +  VENDOR_DEVICE_PATH        VenMediaNode;
> >> +  KERNEL_FILE_DEVPATH       FileNode;
> >> +  EFI_DEVICE_PATH_PROTOCOL  EndNode;
> >> +} KERNEL_VENMEDIA_FILE_DEVPATH;
> >> +#pragma pack ()
> >> +
> >> +STATIC CONST KERNEL_VENMEDIA_FILE_DEVPATH mKernelDevicePath = {
> >> +  {
> >> +    {
> >> +      MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP,
> >> +      { sizeof (VENDOR_DEVICE_PATH) }
> >> +    },
> >> +    QEMU_KERNEL_LOADER_FS_MEDIA_GUID
> >> +  }, {
> >> +    {
> >> +      MEDIA_DEVICE_PATH, MEDIA_FILEPATH_DP,
> >> +      { sizeof (KERNEL_FILE_DEVPATH) }
> >> +    },
> >> +    L"kernel",
> >> +  }, {
> >> +    END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> >> +    { sizeof (EFI_DEVICE_PATH_PROTOCOL) }
> >> +  }
> >> +};
> >> +
> >> +/**
> >> +  Download the kernel, the initial ramdisk, and the kernel command line from
> >> +  QEMU's fw_cfg. The kernel will be instructed via its command line to load
> >> +  the initrd from the same Simple FileSystem where the kernel was loaded from.
> >> +
> >> +  @param[out] ImageHandle       The image handle that was allocated for
> >> +                                loading the image
> >> +  @param[out] LoadedImage       The loaded image protocol that was installed
> >> +                                on ImageHandle by the LoadImage boot service.
>
> (1) Please remove this parameter. (I've noticed this now, after diffing
> the two implementations of this function, including leading comments.)
>
> The R-b stands.
>

Ah yes - that param went out of date a while ago :-)

  reply	other threads:[~2020-03-05 11:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  9:52 [PATCH v2 00/14] Ovmf: use LoadImage/StartImage for loading command line images Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 01/14] OvmfPkg: add GUID for the QEMU kernel loader fs media device path Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 02/14] OvmfPkg: export abstract QEMU blob filesystem in standalone driver Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 03/14] OvmfPkg: introduce QemuLoadImageLib library class Ard Biesheuvel
2020-03-05  9:37   ` [edk2-devel] " Laszlo Ersek
2020-03-05  9:39     ` Laszlo Ersek
2020-03-05 10:22       ` Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 04/14] OvmfPkg: provide a generic implementation of QemuLoadImageLib Ard Biesheuvel
2020-03-05  9:51   ` [edk2-devel] " Laszlo Ersek
2020-03-05 11:29     ` Laszlo Ersek
2020-03-05 11:37       ` Ard Biesheuvel [this message]
2020-03-04  9:52 ` [PATCH v2 05/14] ArmVirtPkg: incorporate the new QEMU kernel loader driver and library Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 06/14] ArmVirtPkg/PlatformBootManagerLib: switch to separate QEMU loader Ard Biesheuvel
2020-03-05 10:01   ` [edk2-devel] " Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 07/14] OvmfPkg/QemuKernelLoaderFsDxe: don't expose kernel command line Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 08/14] OvmfPkg/QemuKernelLoaderFsDxe: add support for the kernel setup block Ard Biesheuvel
2020-03-05 10:12   ` [edk2-devel] " Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 09/14] OvmfPkg: create protocol and GUID header for legacy loaded images Ard Biesheuvel
2020-03-05 10:31   ` [edk2-devel] " Laszlo Ersek
2020-03-05 10:40     ` Ard Biesheuvel
2020-03-05 14:29       ` Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 10/14] OvmfPkg: implement QEMU loader library for X86 with legacy fallback Ard Biesheuvel
2020-03-05 12:33   ` [edk2-devel] " Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 11/14] OvmfPkg: add new QEMU kernel image loader components Ard Biesheuvel
2020-03-04  9:52 ` [PATCH v2 12/14] OvmfPkg/PlatformBootManagerLib: switch to QemuLoadImageLib Ard Biesheuvel
2020-03-05 12:57   ` [edk2-devel] " Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 13/14] OvmfPkg/QemuKernelLoaderFsDxe: add support for new Linux initrd device path Ard Biesheuvel
2020-03-05 13:19   ` Laszlo Ersek
2020-03-04  9:52 ` [PATCH v2 14/14] OvmfPkg: use generic QEMU image loader for secure boot enabled builds Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKv+Gu81MDhhFLJPcW2CqyWD1XpqGa0Cvm_rxGCWEf6XjKrKCw@mail.gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox