From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 66DCF740045 for ; Mon, 29 Apr 2024 06:56:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=YlBz35Qkrqtzpevu1P/aDuhnsih+y7actRoLoZr6Tl0=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1714373794; v=1; b=cGftAkxg9CiWeYQGCoRClj4AqW0eVmcIMC2aDvFnhEZkZXAbZSx1oG7ytVl+Clt/EYobFCxu j0SZ/tpmDUkUsQ4Sqf++a8F/aB1KepltJDu/8H5SaUvqm4hrziMm3dJ3f3rY5Ev/RKF49Qrn71e 2SvemSJqr/Jujrzg505eUVDYfEM/EQJMwg5Ju7WdaLR0At8r/zMwgQlbD7FlXmOHHKO4uVXeHpE iRzlJ4as0YrK9qppLA1oey648Hhfy/lGN0y5zLzinoJ2gT+KgalZ0Tim7jhKNiMIRjaOuhoLHVV ZF5MElyaSSkE99PikmitC23yAGmsOavTXTLseIiiv9WlA== X-Received: by 127.0.0.2 with SMTP id ZoAmYY7687511xQmx7b9GXwG; Sun, 28 Apr 2024 23:56:34 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.14670.1714373793137721892 for ; Sun, 28 Apr 2024 23:56:33 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 84B8D60C0A for ; Mon, 29 Apr 2024 06:56:32 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32994C4AF61 for ; Mon, 29 Apr 2024 06:56:32 +0000 (UTC) X-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2db17e8767cso47464771fa.3 for ; Sun, 28 Apr 2024 23:56:32 -0700 (PDT) X-Gm-Message-State: TSTgTZpcM6hXZJh6o5f9UoV3x7686176AA= X-Google-Smtp-Source: AGHT+IGzAw6rbC75dPUMV5uLD6AMwcQP2Fx9tEItf6W+h1QmIps4dM6HuShnax25KBocr4rTsgXIhLRzvGxgdR/osCk= X-Received: by 2002:a2e:bb83:0:b0:2da:ea02:3655 with SMTP id y3-20020a2ebb83000000b002daea023655mr5266585lje.4.1714373790612; Sun, 28 Apr 2024 23:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20240426082827.68489-1-lichao@loongson.cn> <4e7dc099-7b05-4a8f-8fa9-a72784507adf@loongson.cn> In-Reply-To: <4e7dc099-7b05-4a8f-8fa9-a72784507adf@loongson.cn> From: "Ard Biesheuvel" Date: Mon, 29 Apr 2024 08:56:19 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v4 0/8] Adjust the QemuFwCfgLibMmio and add PEI stage To: Chao Li Cc: devel@edk2.groups.io, Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Leif Lindholm , Sami Mujawar , Sunil V L , Andrei Warkentin Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 28 Apr 2024 23:56:33 -0700 Resent-From: ardb@kernel.org Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=cGftAkxg; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Mon, 29 Apr 2024 at 03:17, Chao Li 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] -=-=-=-=-=-=-=-=-=-=-=-