From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 78CE8D81110 for ; Mon, 9 Oct 2023 08:40:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UFq5NaGtAT1U0hH6W/7InT5gkFdrk9StbWmE/qqH9CE=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1696840819; v=1; b=U6wvI8FgGbnFhj00z63r+Zpbe9QX5VYULJJr2ASq8VFxa/e5CfHbeC2aZ6k4WOYuqQ162Qb0 +7uIBBwbXDyfWMfaPAeXqhkOIYdJ4EMf4h9NtL1blYlI22+w1WrewcKFl2ngwkhLaZ7BYMnl3AL gUP77bpcIlAredGV3Ed2saeI= X-Received: by 127.0.0.2 with SMTP id rnhxYY7687511xXlHDG9COMj; Mon, 09 Oct 2023 01:40:19 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.56577.1696840819129755309 for ; Mon, 09 Oct 2023 01:40:19 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-lwx9cQMvNKOvf11ka714tQ-1; Mon, 09 Oct 2023 04:40:12 -0400 X-MC-Unique: lwx9cQMvNKOvf11ka714tQ-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D9591C0BB4A; Mon, 9 Oct 2023 08:40:12 +0000 (UTC) X-Received: from [10.39.192.114] (unknown [10.39.192.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A0A52027045; Mon, 9 Oct 2023 08:40:11 +0000 (UTC) Message-ID: <9a4530f0-3b67-ec68-bec0-ca79049f013e@redhat.com> Date: Mon, 9 Oct 2023 10:40:10 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v5 21/28] OvmfPkg: Add QemuFwCfgParseString to QemuFwCfgSimpleParserLib To: devel@edk2.groups.io, taylor.d.beebe@gmail.com Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann References: <20231009000742.1792-1-taylor.d.beebe@gmail.com> <20231009000742.1792-22-taylor.d.beebe@gmail.com> From: "Laszlo Ersek" In-Reply-To: <20231009000742.1792-22-taylor.d.beebe@gmail.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1WjSMfp4hAhIYfMpVlcB6NSCx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=U6wvI8Fg; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 10/9/23 02:07, Taylor Beebe wrote: > QemuFwCfgParseString allows reading strings from the fw_cfg file. > This function is needed for parsing the memory protection profile > name. >=20 > Signed-off-by: Taylor Beebe > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > --- > OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParser.c | 11 ++= +++++++++ > OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h | 8 ++= ++++++ > 2 files changed, 19 insertions(+) >=20 > diff --git a/OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimplePars= er.c b/OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParser.c > index c9e0091b82d1..63c8711a9f2e 100644 > --- a/OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParser.c > +++ b/OvmfPkg/Library/QemuFwCfgSimpleParserLib/QemuFwCfgSimpleParser.c > @@ -426,3 +426,14 @@ QemuFwCfgParseUintn ( > *Value =3D (UINTN)Uint64; > return RETURN_SUCCESS; > } > + > +RETURN_STATUS > +EFIAPI > +QemuFwCfgParseString ( > + IN CONST CHAR8 *FileName, > + IN OUT UINTN *BufferSize, > + OUT CHAR8 *Buffer > + ) > +{ > + return QemuFwCfgGetAsString (FileName, BufferSize, Buffer); > +} > diff --git a/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h b/OvmfPkg= /Include/Library/QemuFwCfgSimpleParserLib.h > index bcbf3bc4fc96..ea9fcf7b402e 100644 > --- a/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h > +++ b/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h > @@ -125,4 +125,12 @@ QemuFwCfgParseUintn ( > OUT UINTN *Value > ); > =20 > +RETURN_STATUS > +EFIAPI > +QemuFwCfgParseString ( > + IN CONST CHAR8 *FileName, > + IN OUT UINTN *BufferSize, > + OUT CHAR8 *Buffer > + ); > + > #endif // QEMU_FW_CFG_SIMPLE_PARSER_LIB_H_ Instead of this, please: - Rename QemuFwCfgGetAsString() to QemuFwCfgParseString(); make it extern, and EFIAPI. Update internal calls. - Move the leading comment on QemuFwCfgGetAsString() from the C file to the header file. As posted, the newly declared function would not have documentation in the header file, which is inconsistent with the rest of the header. - Place the new function declaration at the top of the header file. As posted, the new declaration falls under the comment // // The following functions behave identically to QemuFwCfgParseUint8(), // only their range checks use MAX_UINT16, MAX_UINT32, MAX_UINT64, MAX_UINT= N, // respectively. // which is wrong. Thanks Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109445): https://edk2.groups.io/g/devel/message/109445 Mute This Topic: https://groups.io/mt/101843365/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-