public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Chao Li <lichao@loongson.cn>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ardb+tianocore@kernel.org>,
	 Gerd Hoffmann <kraxel@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	 Leif Lindholm <quic_llindhol@quicinc.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	 Sunil V L <sunilvl@ventanamicro.com>,
	Andrei Warkentin <andrei.warkentin@intel.com>
Subject: Re: [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage
Date: Mon, 29 Apr 2024 08:56:19 +0200	[thread overview]
Message-ID: <CAMj1kXGdyFrv46nzpPDW2OoL1VRTL5kqMVJu8q9ksCJLJRPcWg@mail.gmail.com> (raw)
In-Reply-To: <4e7dc099-7b05-4a8f-8fa9-a72784507adf@loongson.cn>

On Mon, 29 Apr 2024 at 03:17, Chao Li <lichao@loongson.cn> wrote:
>
> Hi Ard and Gerd and other maintainers,
>
> Could you review this version and give your suggestions?
>

This looks ok to me now, modulo a few minor tweaks (see below) that I
will apply when merging.

I also changed the type signatures to

extern
VOID
(EFIAPI *InternalQemuFwCfgReadBytes) (
  IN UINTN  Size,
  IN VOID   *Buffer  OPTIONAL
  );

Note that the EFIAPI applies to the function itself, not the pointer
so it needs to be inside the ()



--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPei.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgMmioPei.c
@@ -104,7 +104,6 @@ QemuFwCfgInitialize (
   UINT64                FwCfgDmaAddress;
   UINT64                FwCfgDmaSize;
   QEMU_FW_CFG_RESOURCE  *FwCfgResource;
-  VOID                  *Buffer;

   //
   // Check whether the Qemu firmware configure resources HOB has been created,
@@ -125,11 +124,8 @@ QemuFwCfgInitialize (
   //
   // Create resouce memory
   //
-  Buffer = AllocatePages(EFI_SIZE_TO_PAGES (sizeof (QEMU_FW_CFG_RESOURCE)));
-  ASSERT (Buffer != NULL);
-  ZeroMem (Buffer, sizeof (QEMU_FW_CFG_RESOURCE));
-
-  FwCfgResource = (QEMU_FW_CFG_RESOURCE *)Buffer;
+  FwCfgResource = AllocateZeroPool (sizeof (QEMU_FW_CFG_RESOURCE));
+  ASSERT (FwCfgResource != NULL);

   for (Prev = 0; ; Prev = Node) {
     Node = fdt_next_node (DeviceTreeBase, Prev, NULL);
@@ -141,7 +137,7 @@ QemuFwCfgInitialize (
     // Check for memory node
     //
     Type = fdt_getprop (DeviceTreeBase, Node, "compatible", &Len);
-    if ((Type) &&
+    if ((Type != NULL) &&
         (AsciiStrnCmp (Type, "qemu,fw-cfg-mmio", Len) == 0))
     {
       //


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118376): https://edk2.groups.io/g/devel/message/118376
Mute This Topic: https://groups.io/mt/105746786/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-04-29  6:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  8:28 [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 1/8] OvmfPkg: Add a GUID for QemuFwCfgLib Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 2/8] OvmfPkg: Separate QemuFwCfgLibMmio.c into two files Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 3/8] OvmfPkg: Add the way of HOBs in QemuFwCfgLibMmio Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 4/8] OvmfPkg: Add the QemuFwCfgMmioLib PEI stage version Chao Li
2024-04-29 13:11   ` Ard Biesheuvel
2024-04-30  1:19     ` Chao Li
     [not found]     ` <17CAEA1048BCCAB8.26557@groups.io>
2024-04-30  2:15       ` Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 5/8] OvmfPkg: Copy the same new INF as QemuFwCfgLibMmio.inf Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 6/8] ArmVirtPkg: Enable QemuFwCfgMmioDxeLib.inf Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 7/8] OvmfPkg/RiscVVirt: " Chao Li
2024-04-26  8:29 ` [edk2-devel] [PATCH v4 8/8] OvmfPkg: Remove QemuFwCfgLibMmio.inf Chao Li
2024-04-29  1:17 ` [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage Chao Li
2024-04-29  6:56   ` Ard Biesheuvel [this message]
2024-04-29  7:09     ` Chao Li
2024-04-29  7:14       ` Ard Biesheuvel
2024-04-29  7:23         ` Chao Li

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=CAMj1kXGdyFrv46nzpPDW2OoL1VRTL5kqMVJu8q9ksCJLJRPcWg@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