public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sivaraman Nainar" <sivaramann@amiindia.co.in>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wu, Jiaxin" <jiaxin.wu@intel.com>
Subject: reg: [edk2] [PATCH v1] NetworkPkg/SNPDxe: Validate the Memory BAR as per UEFI Spec
Date: Wed, 4 Dec 2019 10:06:24 +0000	[thread overview]
Message-ID: <B4DE137BDB63634BAC03BD9DE765F197029AE4D966@VENUS1.in.megatrends.com> (raw)

[-- 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 --]

             reply	other threads:[~2019-12-04 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 10:06 Sivaraman Nainar [this message]
2020-01-14 12:37 ` [edk2-devel] reg: [edk2] [PATCH v1] NetworkPkg/SNPDxe: Validate the Memory BAR as per UEFI Spec Maciej Rabeda

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=B4DE137BDB63634BAC03BD9DE765F197029AE4D966@VENUS1.in.megatrends.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