public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* reg: [edk2] [PATCH v1] NetworkPkg/SNPDxe: Validate the Memory BAR as per UEFI Spec
@ 2019-12-04 10:06 Sivaraman Nainar
  2020-01-14 12:37 ` [edk2-devel] " Maciej Rabeda
  0 siblings, 1 reply; 2+ messages in thread
From: Sivaraman Nainar @ 2019-12-04 10:06 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Wu, Jiaxin

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2335



This patch is to check the PCI Memory Base Address Register is valid or not.



*** a\NetworkPkg\SnpDxe\Snp.c           2019-11-11 16:53:40.773300500 +0530

--- b\NetworkPkg\SnpDxe\Snp.c                             2019-11-03 18:46:02.000000000 +0530

*************** SimpleNetworkDriverStart (

*** 266,272 ****

    UINT8                                     BarIndex;

    PXE_STATFLAGS                             InitStatFlags;

    EFI_PCI_IO_PROTOCOL                       *PciIo;

!   EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR   *BarDesc = NULL;

    BOOLEAN                                   FoundIoBar;

    BOOLEAN                                   FoundMemoryBar;



--- 266,272 ----

    UINT8                                     BarIndex;

   PXE_STATFLAGS                             InitStatFlags;

    EFI_PCI_IO_PROTOCOL                       *PciIo;

!   EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR         *BarDesc;

    BOOLEAN                                   FoundIoBar;

    BOOLEAN                                   FoundMemoryBar;



*************** SimpleNetworkDriverStart (

*** 481,494 ****

      } else if (EFI_ERROR (Status)) {

        goto Error_DeleteSNP;

      }

!              //PXE boot fails with cards having non-continuous BAR.

!              // From UEFI Spec, GetBarAttributes can have only descriptors of type ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR

!     // and ACPI_END_TAG_DESCRIPTOR.

!     if( BarDesc->Header.Header.Byte != ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR )  {

!       FreePool (BarDesc);

!       continue;

!     }

!

      if ((!FoundMemoryBar) && (BarDesc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM)) {

        Snp->MemoryBarIndex = BarIndex;

        FoundMemoryBar      = TRUE;

--- 481,487 ----

      } else if (EFI_ERROR (Status)) {

        goto Error_DeleteSNP;

      }

!

      if ((!FoundMemoryBar) && (BarDesc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM)) {

        Snp->MemoryBarIndex = BarIndex;

        FoundMemoryBar      = TRUE;


[-- Attachment #2: Type: text/html, Size: 8872 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-14 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-04 10:06 reg: [edk2] [PATCH v1] NetworkPkg/SNPDxe: Validate the Memory BAR as per UEFI Spec Sivaraman Nainar
2020-01-14 12:37 ` [edk2-devel] " Maciej Rabeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox