* [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table
@ 2018-04-23 7:05 Star Zeng
2018-04-23 8:44 ` Yao, Jiewen
2018-04-23 15:25 ` Kinney, Michael D
0 siblings, 2 replies; 3+ messages in thread
From: Star Zeng @ 2018-04-23 7:05 UTC (permalink / raw)
To: edk2-devel; +Cc: Star Zeng, Jiewen Yao, Michael D Kinney, Sean Brogan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=933
We see UEFI spec is saying to use EfiBootServicesData for ESRT table.
UEFI 2.7 chapter 23.3:
The ESRT shall be stored in memory of type EfiBootServicesData.
And we see EsrtDxe is using AllocatePool for ESRT table, but
EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT table.
This patch updates code to use EfiBootServicesData for ESRT table
in EsrtFmpDxe.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
index 3da4a62fb1c4..cc9dd63b53cd 100644
--- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
+++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
@@ -190,7 +190,7 @@ CreateEsrtEntry (
}
NewSize = ((mTable->FwResourceCountMax + GROWTH_STEP) * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE);
- NewTable = AllocateRuntimeZeroPool (NewSize);
+ NewTable = AllocateZeroPool (NewSize);
if (NewTable == NULL) {
DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory larger table for ESRT. \n"));
return EFI_OUT_OF_RESOURCES;
@@ -439,7 +439,7 @@ EsrtFmpEntryPoint (
//
// Allocate Memory for table
//
- mTable = AllocateRuntimeZeroPool (
+ mTable = AllocateZeroPool (
(GROWTH_STEP * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE)
);
ASSERT (mTable != NULL);
--
2.7.0.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table
2018-04-23 7:05 [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table Star Zeng
@ 2018-04-23 8:44 ` Yao, Jiewen
2018-04-23 15:25 ` Kinney, Michael D
1 sibling, 0 replies; 3+ messages in thread
From: Yao, Jiewen @ 2018-04-23 8:44 UTC (permalink / raw)
To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Kinney, Michael D, Sean Brogan
Reviewed-by: Jiewen.yao@Intel.com
> -----Original Message-----
> From: Zeng, Star
> Sent: Monday, April 23, 2018 3:06 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Subject: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT
> table
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=933
>
> We see UEFI spec is saying to use EfiBootServicesData for ESRT table.
>
> UEFI 2.7 chapter 23.3:
> The ESRT shall be stored in memory of type EfiBootServicesData.
>
> And we see EsrtDxe is using AllocatePool for ESRT table, but
> EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT table.
>
> This patch updates code to use EfiBootServicesData for ESRT table
> in EsrtFmpDxe.
>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
> MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> index 3da4a62fb1c4..cc9dd63b53cd 100644
> --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> @@ -190,7 +190,7 @@ CreateEsrtEntry (
> }
>
> NewSize = ((mTable->FwResourceCountMax + GROWTH_STEP) * sizeof
> (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE);
> - NewTable = AllocateRuntimeZeroPool (NewSize);
> + NewTable = AllocateZeroPool (NewSize);
> if (NewTable == NULL) {
> DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory larger
> table for ESRT. \n"));
> return EFI_OUT_OF_RESOURCES;
> @@ -439,7 +439,7 @@ EsrtFmpEntryPoint (
> //
> // Allocate Memory for table
> //
> - mTable = AllocateRuntimeZeroPool (
> + mTable = AllocateZeroPool (
> (GROWTH_STEP * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) +
> sizeof (EFI_SYSTEM_RESOURCE_TABLE)
> );
> ASSERT (mTable != NULL);
> --
> 2.7.0.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table
2018-04-23 7:05 [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table Star Zeng
2018-04-23 8:44 ` Yao, Jiewen
@ 2018-04-23 15:25 ` Kinney, Michael D
1 sibling, 0 replies; 3+ messages in thread
From: Kinney, Michael D @ 2018-04-23 15:25 UTC (permalink / raw)
To: Zeng, Star, edk2-devel@lists.01.org, Kinney, Michael D
Cc: Yao, Jiewen, Sean Brogan
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Mike
> -----Original Message-----
> From: Zeng, Star
> Sent: Monday, April 23, 2018 12:06 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Sean Brogan
> <sean.brogan@microsoft.com>
> Subject: [PATCH] MdeModulePkg EsrtFmpDxe: Use
> EfiBootServicesData for ESRT table
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=933
>
> We see UEFI spec is saying to use EfiBootServicesData
> for ESRT table.
>
> UEFI 2.7 chapter 23.3:
> The ESRT shall be stored in memory of type
> EfiBootServicesData.
>
> And we see EsrtDxe is using AllocatePool for ESRT table,
> but
> EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT
> table.
>
> This patch updates code to use EfiBootServicesData for
> ESRT table
> in EsrtFmpDxe.
>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
> MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> index 3da4a62fb1c4..cc9dd63b53cd 100644
> --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c
> @@ -190,7 +190,7 @@ CreateEsrtEntry (
> }
>
> NewSize = ((mTable->FwResourceCountMax +
> GROWTH_STEP) * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) +
> sizeof (EFI_SYSTEM_RESOURCE_TABLE);
> - NewTable = AllocateRuntimeZeroPool (NewSize);
> + NewTable = AllocateZeroPool (NewSize);
> if (NewTable == NULL) {
> DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to
> allocate memory larger table for ESRT. \n"));
> return EFI_OUT_OF_RESOURCES;
> @@ -439,7 +439,7 @@ EsrtFmpEntryPoint (
> //
> // Allocate Memory for table
> //
> - mTable = AllocateRuntimeZeroPool (
> + mTable = AllocateZeroPool (
> (GROWTH_STEP * sizeof
> (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof
> (EFI_SYSTEM_RESOURCE_TABLE)
> );
> ASSERT (mTable != NULL);
> --
> 2.7.0.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-23 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 7:05 [PATCH] MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table Star Zeng
2018-04-23 8:44 ` Yao, Jiewen
2018-04-23 15:25 ` Kinney, Michael D
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox