* [PATCH 0/1] MdePkg/UefiDevicePathLib: Add support for PEIMs
@ 2022-01-11 12:13 Albecki, Mateusz
2022-01-11 12:13 ` [PATCH 1/1] " Albecki, Mateusz
0 siblings, 1 reply; 4+ messages in thread
From: Albecki, Mateusz @ 2022-01-11 12:13 UTC (permalink / raw)
To: devel; +Cc: Mateusz Albecki, Michael D Kinney, Liming Gao, Zhiguang Liu
This patch adds support for PEIMs in UefiDevicePathLib. Although this library and DEVICE_PATH_PROTOCOL
itself was initially intended for DXE the use case of unlocking opal-locked storage devices during S3
resume makes it useful in PEI.
As it is the change will break the users who will need to change the name of the infs. This can be avoided at the cost of
a dedicated inf file just for PEI or by keeping the name UefiDevicePathLibStandaloneMm without adding Pei phase indication.
Tests:
- Change has been tested by building a PEI PciHostBridgeLib instance which uses AppendDevicePathNode function. That PciHostBridgeLib was
then used in PEIM that enumerates PCI devices and that PEIM was able to get the root bridge information along with the correct root
bridge device path.
This change is a preparation for a more robust support for PCIe enumeration in PEI. More details on DevicePath use cases in PEI can
be found in this discussion:
https://edk2.groups.io/g/rfc/topic/proposal_to_add_support_for/86658203?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,86658203,previd=1640220793375011242,nextid=1626916856753718458&previd=1640220793375011242&nextid=1626916856753718458
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Mateusz Albecki (1):
MdePkg/UefiDevicePathLib: Add support for PEIMs
.../DevicePathUtilitiesPei.c | 40 +++++++++++++++++++
...c => DevicePathUtilitiesPeiStandaloneMm.c} | 0
.../UefiDevicePathLib/UefiDevicePathLib.inf | 2 +-
...f => UefiDevicePathLibPeiStandaloneMm.inf} | 4 +-
MdePkg/MdePkg.dsc | 2 +-
5 files changed, 44 insertions(+), 4 deletions(-)
create mode 100644 MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesPei.c
rename MdePkg/Library/UefiDevicePathLib/{DevicePathUtilitiesStandaloneMm.c => DevicePathUtilitiesPeiStandaloneMm.c} (100%)
rename MdePkg/Library/UefiDevicePathLib/{UefiDevicePathLibStandaloneMm.inf => UefiDevicePathLibPeiStandaloneMm.inf} (93%)
--
2.28.0.windows.1
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] MdePkg/UefiDevicePathLib: Add support for PEIMs
2022-01-11 12:13 [PATCH 0/1] MdePkg/UefiDevicePathLib: Add support for PEIMs Albecki, Mateusz
@ 2022-01-11 12:13 ` Albecki, Mateusz
2022-04-21 22:21 ` [edk2-devel] " Michael D Kinney
0 siblings, 1 reply; 4+ messages in thread
From: Albecki, Mateusz @ 2022-01-11 12:13 UTC (permalink / raw)
To: devel; +Cc: Mateusz Albecki, Michael D Kinney, Liming Gao, Zhiguang Liu
DevicePathLib utilities are useful in PEI to locate the devices which need
an opal unlock on S3 resume. This commit reuses the implementation done
to support Standalone MM for PEI.
Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
---
...iesStandaloneMm.c => DevicePathUtilitiesPeiStandaloneMm.c} | 0
...bStandaloneMm.inf => UefiDevicePathLibPeiStandaloneMm.inf} | 4 ++--
MdePkg/MdePkg.dsc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
rename MdePkg/Library/UefiDevicePathLib/{DevicePathUtilitiesStandaloneMm.c => DevicePathUtilitiesPeiStandaloneMm.c} (100%)
rename MdePkg/Library/UefiDevicePathLib/{UefiDevicePathLibStandaloneMm.inf => UefiDevicePathLibPeiStandaloneMm.inf} (93%)
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesPeiStandaloneMm.c
similarity index 100%
rename from MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c
rename to MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesPeiStandaloneMm.c
diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
similarity index 93%
rename from MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
rename to MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
index 23fedf38b7..2f39a29aa2 100644
--- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
+++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
@@ -19,7 +19,7 @@
MODULE_TYPE = MM_STANDALONE
PI_SPECIFICATION_VERSION = 0x00010032
VERSION_STRING = 1.0
- LIBRARY_CLASS = DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE
+ LIBRARY_CLASS = DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE PEIM
#
@@ -28,7 +28,7 @@
[Sources]
DevicePathUtilities.c
- DevicePathUtilitiesStandaloneMm.c
+ DevicePathUtilitiesPeiStandaloneMm.c
DevicePathToText.c
DevicePathFromText.c
UefiDevicePathLib.c
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index a94959169b..3345404cc1 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -111,7 +111,7 @@
MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
+ MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf
MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
--
2.28.0.windows.1
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH 1/1] MdePkg/UefiDevicePathLib: Add support for PEIMs
2022-01-11 12:13 ` [PATCH 1/1] " Albecki, Mateusz
@ 2022-04-21 22:21 ` Michael D Kinney
2022-04-21 22:43 ` Albecki, Mateusz
0 siblings, 1 reply; 4+ messages in thread
From: Michael D Kinney @ 2022-04-21 22:21 UTC (permalink / raw)
To: devel@edk2.groups.io, Albecki, Mateusz, Kinney, Michael D
Cc: Gao, Liming, Liu, Zhiguang
Mateusz,
I recommend just adding PEIM to the existing INF and not changing the name
of the C/INF file. Please update the file headers for both the existing
INF and C file to describe the module types this library is compatible with.
This allows platform developers to understand the compatibility even though
the INF filename does not express all the compatibility.
This minimizes the impact to and existing DSC files that may be using the
current INF filename.
Mike
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Albecki, Mateusz
> Sent: Tuesday, January 11, 2022 4:14 AM
> To: devel@edk2.groups.io
> Cc: Albecki, Mateusz <mateusz.albecki@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>
> Subject: [edk2-devel] [PATCH 1/1] MdePkg/UefiDevicePathLib: Add support for PEIMs
>
> DevicePathLib utilities are useful in PEI to locate the devices which need
> an opal unlock on S3 resume. This commit reuses the implementation done
> to support Standalone MM for PEI.
>
> Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
> ...iesStandaloneMm.c => DevicePathUtilitiesPeiStandaloneMm.c} | 0
> ...bStandaloneMm.inf => UefiDevicePathLibPeiStandaloneMm.inf} | 4 ++--
> MdePkg/MdePkg.dsc | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
> rename MdePkg/Library/UefiDevicePathLib/{DevicePathUtilitiesStandaloneMm.c => DevicePathUtilitiesPeiStandaloneMm.c} (100%)
> rename MdePkg/Library/UefiDevicePathLib/{UefiDevicePathLibStandaloneMm.inf => UefiDevicePathLibPeiStandaloneMm.inf} (93%)
>
> diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c
> b/MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesPeiStandaloneMm.c
> similarity index 100%
> rename from MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesStandaloneMm.c
> rename to MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesPeiStandaloneMm.c
> diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
> b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
> similarity index 93%
> rename from MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
> rename to MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
> index 23fedf38b7..2f39a29aa2 100644
> --- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
> +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
> @@ -19,7 +19,7 @@
> MODULE_TYPE = MM_STANDALONE
> PI_SPECIFICATION_VERSION = 0x00010032
> VERSION_STRING = 1.0
> - LIBRARY_CLASS = DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE
> + LIBRARY_CLASS = DevicePathLib | MM_STANDALONE MM_CORE_STANDALONE PEIM
>
>
> #
> @@ -28,7 +28,7 @@
>
> [Sources]
> DevicePathUtilities.c
> - DevicePathUtilitiesStandaloneMm.c
> + DevicePathUtilitiesPeiStandaloneMm.c
> DevicePathToText.c
> DevicePathFromText.c
> UefiDevicePathLib.c
> diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
> index a94959169b..3345404cc1 100644
> --- a/MdePkg/MdePkg.dsc
> +++ b/MdePkg/MdePkg.dsc
> @@ -111,7 +111,7 @@
> MdePkg/Library/UefiDebugLibDebugPortProtocol/UefiDebugLibDebugPortProtocol.inf
> MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
> MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
> - MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibStandaloneMm.inf
> + MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibPeiStandaloneMm.inf
> MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf
> MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
> MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
> --
> 2.28.0.windows.1
>
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego -
> KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie
> przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
> przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are
> not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is
> strictly prohibited.
>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-21 22:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11 12:13 [PATCH 0/1] MdePkg/UefiDevicePathLib: Add support for PEIMs Albecki, Mateusz
2022-01-11 12:13 ` [PATCH 1/1] " Albecki, Mateusz
2022-04-21 22:21 ` [edk2-devel] " Michael D Kinney
2022-04-21 22:43 ` Albecki, Mateusz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox