[edk2-devel] Recent changes to EsrtFmp causing ASSERTs

Rothman, Michael A michael.a.rothman at intel.com
Mon Sep 30 20:52:58 UTC 2019


Jason, Agreed - though that image you sent was challenging for these old eyes. Black on dark grey? Ack!

Thanks,
Michael A. Rothman
---------------------------------------------------------------
Let no excuse be a barrier to your success.

On Sep 30, 2019, at 1:48 PM, "jason.spottswood at hpe.com<mailto:jason.spottswood at hpe.com>" <jason.spottswood at hpe.com<mailto:jason.spottswood at hpe.com>> wrote:

In EsrtFmp.c, function CreateEsrtEntry, line 196, the code asserts if the FMP image hardware instance matches that of an existing instance.  This is fine if the hardware instance is supported.  The field is optional though.  In the UEFI spec, "a zero hardware instance means the FMP provider is not able to determine a unique hardware instance number or a hardware instance number is not needed."  The code below needs to also check if the hardware instance is supported (by comparing it to zero) before checking it against existing entries.


  //
  // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique
  //
  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;
      }
    }
  }




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48313): https://edk2.groups.io/g/devel/message/48313
Mute This Topic: https://groups.io/mt/34350126/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20190930/f52f5fcb/attachment.htm>


More information about the edk2-devel-archive mailing list