[edk2-devel] reg: [edk2] [PATCH v1] NetworkPkg/SNPDxe: Validate the Memory BAR as per UEFI Spec

Maciej Rabeda maciej.rabeda at linux.intel.com
Tue Jan 14 12:37:11 UTC 2020


Hello Siva,

Which tools did you use to generate this patch? I cannot apply it via 
'git am' command.
Did you follow the edk2 git guide (using git format-patch && git 
send-email commands)?
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo's-unkempt-git-guide-for-edk2-contributors-and-maintainers

Thanks,
Maciej

On 04-Dec-19 11:06, Sivaraman Nainar wrote:
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2335 
> <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;
>
> 

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

View/Reply Online (#53221): https://edk2.groups.io/g/devel/message/53221
Mute This Topic: https://groups.io/mt/66429976/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/20200114/dbb09dc4/attachment.htm>


More information about the edk2-devel-archive mailing list