From: "Jeff Brasen" <jbrasen@nvidia.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "jian.j.wang@intel.com" <jian.j.wang@intel.com>,
"gaoliming@byosoft.com.cn" <gaoliming@byosoft.com.cn>,
"guomin.jiang@intel.com" <guomin.jiang@intel.com>
Subject: Re: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices with 0 HardwareInstance
Date: Wed, 1 Feb 2023 16:21:23 +0000 [thread overview]
Message-ID: <DS7PR12MB578981FEE6FB4651FE76115BCBD19@DS7PR12MB5789.namprd12.prod.outlook.com> (raw)
In-Reply-To: <3c3226e6c05a868f3f88d300181a157998c2786e.1670873141.git.jbrasen@nvidia.com>
Any updates on this would be great to get this in for the next stable release if possible.
> -----Original Message-----
> From: Jeff Brasen <jbrasen@nvidia.com>
> Sent: Monday, December 12, 2022 12:27 PM
> To: devel@edk2.groups.io
> Cc: jian.j.wang@intel.com; gaoliming@byosoft.com.cn;
> guomin.jiang@intel.com; Jeff Brasen <jbrasen@nvidia.com>
> Subject: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices
> with 0 HardwareInstance
>
> Skip error check if HardwareInstance is 0 as this either means that
> FmpVersion < 3 and not supported or, "A zero means the FMP provider is not
> able to determine a unique hardware instance number or a hardware
> instance number is not needed." per UEFI specification.
>
> As the FmpInstances are merged and HardwareInstance is not used remove
> error check in this case.
>
>
> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
> ---
> MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 22 ++++++++++++------
> ---
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> index 4f47c55cce..5bc627461d 100644
> --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> @@ -153,16 +153,20 @@ CreateEsrtEntry (
>
> //
> // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique
> + // Skip if HardwareInstance is 0 as this is the case if FmpVersion <
> + 3 // or the device can not create a unique ID per UEFI specification
> //
> - for (Index = 0; Index < *NumberOfDescriptors; Index++) {
> - if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid,
> &FmpImageInfoBuf->ImageTypeId)) {
> - if (HardwareInstances[Index].HardwareInstance ==
> FmpHardwareInstance) {
> - DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image
> descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf-
> >ImageTypeId, FmpHardwareInstance));
> - ASSERT (
> - !CompareGuid (&HardwareInstances[Index].ImageTypeGuid,
> &FmpImageInfoBuf->ImageTypeId) ||
> - HardwareInstances[Index].HardwareInstance !=
> FmpHardwareInstance
> - );
> - return EFI_UNSUPPORTED;
> + if (FmpHardwareInstance != 0) {
> + for (Index = 0; Index < *NumberOfDescriptors; Index++) {
> + if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid,
> &FmpImageInfoBuf->ImageTypeId)) {
> + if (HardwareInstances[Index].HardwareInstance ==
> FmpHardwareInstance) {
> + DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image
> descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf-
> >ImageTypeId, FmpHardwareInstance));
> + ASSERT (
> + !CompareGuid (&HardwareInstances[Index].ImageTypeGuid,
> &FmpImageInfoBuf->ImageTypeId) ||
> + HardwareInstances[Index].HardwareInstance !=
> FmpHardwareInstance
> + );
> + return EFI_UNSUPPORTED;
> + }
> }
> }
> }
> --
> 2.25.1
next prev parent reply other threads:[~2023-02-01 16:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 19:27 [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices with 0 HardwareInstance Jeff Brasen
2023-02-01 16:21 ` Jeff Brasen [this message]
2023-02-09 22:02 ` FW: " Jeff Brasen
2023-02-10 3:42 ` Michael D Kinney
2023-02-10 16:44 ` Jeff Brasen
2023-02-10 19:47 ` [edk2-devel] " Michael D Kinney
2023-02-10 20:43 ` Jeff Brasen
2023-02-10 21:17 ` Michael D Kinney
2023-02-10 21:20 ` Jeff Brasen
2023-02-14 23:50 ` Michael D Kinney
2023-02-15 1:59 ` Michael D Kinney
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=DS7PR12MB578981FEE6FB4651FE76115BCBD19@DS7PR12MB5789.namprd12.prod.outlook.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