[edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs

Marcello Sylvester Bauer posted 2 patches 3 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20200915122616.17196-1-marcello.bauer@9elements.com
UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426 ++++++++++++++++++++
7 files changed, 500 insertions(+), 4 deletions(-)
create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c
[edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
Posted by Marcello Sylvester Bauer 3 years, 7 months ago
Fix Option ROM enumeration and support scanning.

v2:
* add correct Maintainer and Reviewer to Cc
* PciPlatformDxe:
  - Update description
  - add function description

Branch: https://github.com/9elements/edk2-1/tree/UefiPayloadPkg-Option_ROMs
PR: https://github.com/tianocore/edk2/pull/926

Patrick Rudolph (2):
  MdeModulePkg: Fix OptionROM scanning
  UefiPayloadPkg: Scan for Option ROMs

 UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
 UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
 UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
 MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426 ++++++++++++++++++++
 7 files changed, 500 insertions(+), 4 deletions(-)
 create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
 create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
 create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c

-- 
2.28.0


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

View/Reply Online (#65271): https://edk2.groups.io/g/devel/message/65271
Mute This Topic: https://groups.io/mt/76863515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
Posted by Ni, Ray 3 years, 7 months ago
Why running it will disable the ability of PciPlatform code to scan for ROMs?

I guess it is because the PciIoDevice->AllOpRomProcessed is set which causes GetPciRom() is skipped.

Can you explain more in the code comment?

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marcello
> Sylvester Bauer
> Sent: Tuesday, September 15, 2020 8:26 PM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
> 
> Fix Option ROM enumeration and support scanning.
> 
> v2:
> * add correct Maintainer and Reviewer to Cc
> * PciPlatformDxe:
>   - Update description
>   - add function description
> 
> Branch: https://github.com/9elements/edk2-1/tree/UefiPayloadPkg-
> Option_ROMs
> PR: https://github.com/tianocore/edk2/pull/926
> 
> Patrick Rudolph (2):
>   MdeModulePkg: Fix OptionROM scanning
>   UefiPayloadPkg: Scan for Option ROMs
> 
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
>  UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426
> ++++++++++++++++++++
>  7 files changed, 500 insertions(+), 4 deletions(-)
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c
> 
> --
> 2.28.0
> 
> 
> 


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

View/Reply Online (#65312): https://edk2.groups.io/g/devel/message/65312
Mute This Topic: https://groups.io/mt/76863515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
Posted by Marcello Sylvester Bauer 3 years, 7 months ago
hi Ray,

> I guess it is because the PciIoDevice->AllOpRomProcessed is set which
causes GetPciRom() is skipped.

exactly. Therefore we need this for the gPciPlatformProtocol implementation
to work.
I will add this information as a code comment.

> In your UefiPayloadPkg change, you have an assumption that the option ROM
BAR still contain the correct base address.
> Is it always true in real world? Do you think maybe the boot loader
should supply a MMIO space range so UeifPayloadPkg
> can use for option rom decoding?

Every option ROM in coreboot does have it's own memory space and can not be
provided as MMIO space range. Probably we could
add some kind of validation to verify the validity of the base address.

thanks,
Marcello


On Wed, Sep 16, 2020 at 10:28 AM Ni, Ray <ray.ni@intel.com> wrote:

> Why running it will disable the ability of PciPlatform code to scan for
> ROMs?
>
> I guess it is because the PciIoDevice->AllOpRomProcessed is set which
> causes GetPciRom() is skipped.
>
> Can you explain more in the code comment?
>
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marcello
> > Sylvester Bauer
> > Sent: Tuesday, September 15, 2020 8:26 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
> >
> > Fix Option ROM enumeration and support scanning.
> >
> > v2:
> > * add correct Maintainer and Reviewer to Cc
> > * PciPlatformDxe:
> >   - Update description
> >   - add function description
> >
> > Branch: https://github.com/9elements/edk2-1/tree/UefiPayloadPkg-
> > Option_ROMs
> > PR: https://github.com/tianocore/edk2/pull/926
> >
> > Patrick Rudolph (2):
> >   MdeModulePkg: Fix OptionROM scanning
> >   UefiPayloadPkg: Scan for Option ROMs
> >
> >  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
> >  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
> >  UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426
> > ++++++++++++++++++++
> >  7 files changed, 500 insertions(+), 4 deletions(-)
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c
> >
> > --
> > 2.28.0
> >
> >
> > 
>
>

-- 
*[Marcello Sylvester Bauer]*



9elements Agency GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email:  [DEINE EMAIL ADDRESSE]
<https://static.9elements.com/email_signatur.html>
Phone:  *+49 234 68 94 188 <+492346894188>*
Mobile:  *+49 1722847618 <+491722847618>*

Sitz der Gesellschaft: Bochum
Handelsregister: Amtsgericht Bochum, HRB 17519
Geschäftsführung: Sebastian Deutsch, Eray Basar

Datenschutzhinweise nach Art. 13 DSGVO <https://9elements.com/privacy>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65417): https://edk2.groups.io/g/devel/message/65417
Mute This Topic: https://groups.io/mt/76863515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
Posted by Michael D Kinney 3 years, 7 months ago
Marcello,

If the assumption in this env is that PCI enumeration has already been done, would it make
more sense for the component that performed PCI enumeration to collect the PCI Option ROM
contents and pass them into the UefiPayLoadPkg in memory buffers and have the PCI Platform Protocol
provide the PCI Option ROM images from these memory buffers?

Thanks,

Mike

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marcello Sylvester Bauer
Sent: Monday, September 21, 2020 6:25 AM
To: Ni, Ray <ray.ni@intel.com>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs

hi Ray,

> I guess it is because the PciIoDevice->AllOpRomProcessed is set which causes GetPciRom() is skipped.

exactly. Therefore we need this for the gPciPlatformProtocol implementation to work.
I will add this information as a code comment.

> In your UefiPayloadPkg change, you have an assumption that the option ROM BAR still contain the correct base address.
> Is it always true in real world? Do you think maybe the boot loader should supply a MMIO space range so UeifPayloadPkg
> can use for option rom decoding?

Every option ROM in coreboot does have it's own memory space and can not be provided as MMIO space range. Probably we could
add some kind of validation to verify the validity of the base address.

thanks,
Marcello

On Wed, Sep 16, 2020 at 10:28 AM Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>> wrote:
Why running it will disable the ability of PciPlatform code to scan for ROMs?

I guess it is because the PciIoDevice->AllOpRomProcessed is set which causes GetPciRom() is skipped.

Can you explain more in the code comment?

> -----Original Message-----
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Marcello
> Sylvester Bauer
> Sent: Tuesday, September 15, 2020 8:26 PM
> To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Subject: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
>
> Fix Option ROM enumeration and support scanning.
>
> v2:
> * add correct Maintainer and Reviewer to Cc
> * PciPlatformDxe:
>   - Update description
>   - add function description
>
> Branch: https://github.com/9elements/edk2-1/tree/UefiPayloadPkg-
> Option_ROMs
> PR: https://github.com/tianocore/edk2/pull/926
>
> Patrick Rudolph (2):
>   MdeModulePkg: Fix OptionROM scanning
>   UefiPayloadPkg: Scan for Option ROMs
>
>  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
>  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
>  UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
>  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
>  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426
> ++++++++++++++++++++
>  7 files changed, 500 insertions(+), 4 deletions(-)
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
>  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c
>
> --
> 2.28.0
>
>
>


--
[Marcello Sylvester Bauer]

[http://static.9elements.com/logo-signature.png]
9elements Agency GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email:  [DEINE EMAIL ADDRESSE]<https://static.9elements.com/email_signatur.html>
Phone:  +49 234 68 94 188<tel:+492346894188>
Mobile:  +49 1722847618<tel:+491722847618>

Sitz der Gesellschaft: Bochum
Handelsregister: Amtsgericht Bochum, HRB 17519
Geschäftsführung: Sebastian Deutsch, Eray Basar

Datenschutzhinweise nach Art. 13 DSGVO<https://9elements.com/privacy>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65477): https://edk2.groups.io/g/devel/message/65477
Mute This Topic: https://groups.io/mt/76863515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
Posted by Marcello Sylvester Bauer 3 years, 5 months ago
Hi,

> If the assumption in this env is that PCI enumeration has already been
done, would it make

more sense for the component that performed PCI enumeration to collect the
PCI Option ROM

contents and pass them into the UefiPayLoadPkg in memory buffers and have
the PCI Platform Protocol provide the PCI Option ROM images from these
memory buffers?

We did not plan to add extra memory buffers to pass PCI Option ROMs. Is
there any benefit to creating it?

> In your UefiPayloadPkg change, you have an assumption that the option ROM BAR
still contain the correct base address. Is it always true in real world? Do
you think maybe the boot loader should supply a MMIO space range so
UeifPayloadPkg can use for option rom decoding?

We could update UefiPayloadPkg/BuildAndIntegrationInstructions.txt and make
this a requirement for the boot loader to make all option ROM BARs contain
a valid base address.

Thanks,
Marcello

On Wed, Sep 23, 2020 at 1:58 AM Kinney, Michael D <
michael.d.kinney@intel.com> wrote:

> Marcello,
>
>
>
> If the assumption in this env is that PCI enumeration has already been
> done, would it make
>
> more sense for the component that performed PCI enumeration to collect the
> PCI Option ROM
>
> contents and pass them into the UefiPayLoadPkg in memory buffers and have
> the PCI Platform Protocol
>
> provide the PCI Option ROM images from these memory buffers?
>
>
>
> Thanks,
>
>
>
> Mike
>
>
>
> *From:* devel@edk2.groups.io <devel@edk2.groups.io> *On Behalf Of *Marcello
> Sylvester Bauer
> *Sent:* Monday, September 21, 2020 6:25 AM
> *To:* Ni, Ray <ray.ni@intel.com>
> *Cc:* devel@edk2.groups.io
> *Subject:* Re: [edk2-devel] [PATCH v2 0/2] Add support for scanning
> Option ROMs
>
>
>
> hi Ray,
>
> > I guess it is because the PciIoDevice->AllOpRomProcessed is set which
> causes GetPciRom() is skipped.
>
> exactly. Therefore we need this for the gPciPlatformProtocol
> implementation to work.
> I will add this information as a code comment.
>
> > In your UefiPayloadPkg change, you have an assumption that the option
> ROM BAR still contain the correct base address.
> > Is it always true in real world? Do you think maybe the boot loader
> should supply a MMIO space range so UeifPayloadPkg
> > can use for option rom decoding?
>
> Every option ROM in coreboot does have it's own memory space and can not
> be provided as MMIO space range. Probably we could
> add some kind of validation to verify the validity of the base address.
>
> thanks,
> Marcello
>
>
>
> On Wed, Sep 16, 2020 at 10:28 AM Ni, Ray <ray.ni@intel.com> wrote:
>
> Why running it will disable the ability of PciPlatform code to scan for
> ROMs?
>
> I guess it is because the PciIoDevice->AllOpRomProcessed is set which
> causes GetPciRom() is skipped.
>
> Can you explain more in the code comment?
>
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Marcello
> > Sylvester Bauer
> > Sent: Tuesday, September 15, 2020 8:26 PM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH v2 0/2] Add support for scanning Option ROMs
> >
> > Fix Option ROM enumeration and support scanning.
> >
> > v2:
> > * add correct Maintainer and Reviewer to Cc
> > * PciPlatformDxe:
> >   - Update description
> >   - add function description
> >
> > Branch: https://github.com/9elements/edk2-1/tree/UefiPayloadPkg-
> > Option_ROMs
> > PR: https://github.com/tianocore/edk2/pull/926
> >
> > Patrick Rudolph (2):
> >   MdeModulePkg: Fix OptionROM scanning
> >   UefiPayloadPkg: Scan for Option ROMs
> >
> >  UefiPayloadPkg/UefiPayloadPkgIa32.dsc                 |   1 +
> >  UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc              |   1 +
> >  UefiPayloadPkg/UefiPayloadPkg.fdf                     |   1 +
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf      |  46 +++
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h        |  19 +
> >  MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c |  10 +-
> >  UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c        | 426
> > ++++++++++++++++++++
> >  7 files changed, 500 insertions(+), 4 deletions(-)
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.inf
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.h
> >  create mode 100644 UefiPayloadPkg/PciPlatformDxe/PciPlatformDxe.c
> >
> > --
> > 2.28.0
> >
> >
> >
>
>
>
>
> --
>
> *[Marcello Sylvester Bauer]*
>
>
>
> 9elements Agency GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
>
> Email:  [DEINE EMAIL ADDRESSE]
> <https://static.9elements.com/email_signatur.html>
>
> Phone:  *+49 234 68 94 188 <+492346894188>*
>
> Mobile:  *+49 1722847618 <+491722847618>*
>
>
>
> Sitz der Gesellschaft: Bochum
>
> Handelsregister: Amtsgericht Bochum, HRB 17519
>
> Geschäftsführung: Sebastian Deutsch, Eray Basar
>
>
> Datenschutzhinweise nach Art. 13 DSGVO <https://9elements.com/privacy>
>
> 
>


-- 
*[Marcello Sylvester Bauer]*



9elements Agency GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email:  [DEINE EMAIL ADDRESSE]
<https://static.9elements.com/email_signatur.html>
Phone:  *+49 234 68 94 188 <+492346894188>*
Mobile:  *+49 1722847618 <+491722847618>*

Sitz der Gesellschaft: Bochum
Handelsregister: Amtsgericht Bochum, HRB 17519
Geschäftsführung: Sebastian Deutsch, Eray Basar

Datenschutzhinweise nach Art. 13 DSGVO <https://9elements.com/privacy>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#67230): https://edk2.groups.io/g/devel/message/67230
Mute This Topic: https://groups.io/mt/76863515/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-