* [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes
@ 2021-09-09 3:45 Michael Kubacki
2021-09-09 3:45 ` [PATCH v1 1/3] MdeModulePkg/Core/Pei: Fix typo in function descriptions Michael Kubacki
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Michael Kubacki @ 2021-09-09 3:45 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao, Dandan Bi
From: Michael Kubacki <michael.kubacki@microsoft.com>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512
This patch series contains three patches. The first two are for
relatively minor improvments - a typo fix in function descriptions
and changing the error level of a debug print. The third patch
fixes a pointer size mismatch.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Michael Kubacki (3):
MdeModulePkg/Core/Pei: Fix typo in function descriptions
MdeModulePkg/Core/Pei: Make migrated PEIM message verbose
MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 13 ++++++++-----
MdeModulePkg/Core/Pei/PeiMain.h | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
--
2.28.0.windows.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 1/3] MdeModulePkg/Core/Pei: Fix typo in function descriptions
2021-09-09 3:45 [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes Michael Kubacki
@ 2021-09-09 3:45 ` Michael Kubacki
2021-09-09 3:46 ` [PATCH v1 2/3] MdeModulePkg/Core/Pei: Make migrated PEIM message verbose Michael Kubacki
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michael Kubacki @ 2021-09-09 3:45 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao, Dandan Bi
From: Michael Kubacki <michael.kubacki@microsoft.com>
Corrects a typo in the return value description of MigratePeim() and
EvacuateTempRam():
"Succesfully" to "Successfully"
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 ++--
MdeModulePkg/Core/Pei/PeiMain.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 61d4b67c64b9..8780297a77fc 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -958,7 +958,7 @@ PeiCheckAndSwitchStack (
@param PeimFileHandle Pointer to the FFS file header of the image.
@param MigratedFileHandle Pointer to the FFS file header of the migrated image.
- @retval EFI_SUCCESS Sucessfully migrated the PEIM to permanent memory.
+ @retval EFI_SUCCESS Successfully migrated the PEIM to permanent memory.
**/
EFI_STATUS
@@ -1120,7 +1120,7 @@ MigratePeimsInFv (
environment, such as the size and location of temporary RAM, the stack location and
the BFV location.
- @retval EFI_SUCCESS Succesfully migrated installed FVs from temporary RAM to permanent memory.
+ @retval EFI_SUCCESS Successfully migrated installed FVs from temporary RAM to permanent memory.
@retval EFI_OUT_OF_RESOURCES Insufficient memory exists to allocate needed pages.
**/
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index daa48b4c5f37..0046f19447ba 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -419,7 +419,7 @@ MigratePeim (
environment, such as the size and location of temporary RAM, the stack location and
the BFV location.
- @retval EFI_SUCCESS Succesfully migrated installed FVs from temporary RAM to permanent memory.
+ @retval EFI_SUCCESS Successfully migrated installed FVs from temporary RAM to permanent memory.
@retval EFI_OUT_OF_RESOURCES Insufficient memory exists to allocate needed pages.
**/
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/3] MdeModulePkg/Core/Pei: Make migrated PEIM message verbose
2021-09-09 3:45 [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes Michael Kubacki
2021-09-09 3:45 ` [PATCH v1 1/3] MdeModulePkg/Core/Pei: Fix typo in function descriptions Michael Kubacki
@ 2021-09-09 3:46 ` Michael Kubacki
2021-09-09 3:46 ` [PATCH v1 3/3] MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam() Michael Kubacki
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michael Kubacki @ 2021-09-09 3:46 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao, Dandan Bi
From: Michael Kubacki <michael.kubacki@microsoft.com>
Currently, the debug message that prints the name of a PEIM
being migrated is DEBUG_INFO while similar messages are
DEBUG_VERBOSE. This change updates the print level to
DEBUG_VERBOSE for consistency.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 8780297a77fc..a050a6ed9646 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -993,7 +993,7 @@ MigratePeim (
AsciiString[Index] = 0;
}
}
- DEBUG ((DEBUG_INFO, "%a", AsciiString));
+ DEBUG ((DEBUG_VERBOSE, "%a", AsciiString));
DEBUG_CODE_END ();
Pe32Data = (VOID *) ((UINTN) ImageAddress - (UINTN) MigratedFileHandle + (UINTN) FileHandle);
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 3/3] MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()
2021-09-09 3:45 [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes Michael Kubacki
2021-09-09 3:45 ` [PATCH v1 1/3] MdeModulePkg/Core/Pei: Fix typo in function descriptions Michael Kubacki
2021-09-09 3:46 ` [PATCH v1 2/3] MdeModulePkg/Core/Pei: Make migrated PEIM message verbose Michael Kubacki
@ 2021-09-09 3:46 ` Michael Kubacki
2021-09-10 4:51 ` 回复: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes gaoliming
[not found] ` <16A35CCD00964177.18571@groups.io>
4 siblings, 0 replies; 6+ messages in thread
From: Michael Kubacki @ 2021-09-09 3:46 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Liming Gao, Dandan Bi
From: Michael Kubacki <michael.kubacki@microsoft.com>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512
In 32-bit PEI, the local variable pointers MigratedFvHeader and
RawDataFvHeader in EvacuateTempRam() will be 32-bit in size. The
pointers are currently passed to PeiServicesAllocatePages() which
expects a 64-bit output buffer of type EFI_PHYSICAL_ADDRESS.
When PeiServicesAllocatePages() writes to the buffer, the data
can overflow.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index a050a6ed9646..f6bb906f38f3 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1135,6 +1135,7 @@ EvacuateTempRam (
volatile UINTN FvIndex;
volatile UINTN FvChildIndex;
UINTN ChildFvOffset;
+ EFI_PHYSICAL_ADDRESS FvHeaderAddress;
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
EFI_FIRMWARE_VOLUME_HEADER *ChildFvHeader;
EFI_FIRMWARE_VOLUME_HEADER *MigratedFvHeader;
@@ -1186,9 +1187,10 @@ EvacuateTempRam (
Status = PeiServicesAllocatePages (
EfiBootServicesCode,
EFI_SIZE_TO_PAGES ((UINTN) FvHeader->FvLength),
- (EFI_PHYSICAL_ADDRESS *) &MigratedFvHeader
+ &FvHeaderAddress
);
ASSERT_EFI_ERROR (Status);
+ MigratedFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAddress;
//
// Allocate pool to save the raw PEIMs, which is used to keep consistent context across
@@ -1197,9 +1199,10 @@ EvacuateTempRam (
Status = PeiServicesAllocatePages (
EfiBootServicesCode,
EFI_SIZE_TO_PAGES ((UINTN) FvHeader->FvLength),
- (EFI_PHYSICAL_ADDRESS *) &RawDataFvHeader
+ &FvHeaderAddress
);
ASSERT_EFI_ERROR (Status);
+ RawDataFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAddress;
DEBUG ((
DEBUG_VERBOSE,
--
2.28.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* 回复: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes
2021-09-09 3:45 [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes Michael Kubacki
` (2 preceding siblings ...)
2021-09-09 3:46 ` [PATCH v1 3/3] MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam() Michael Kubacki
@ 2021-09-10 4:51 ` gaoliming
[not found] ` <16A35CCD00964177.18571@groups.io>
4 siblings, 0 replies; 6+ messages in thread
From: gaoliming @ 2021-09-10 4:51 UTC (permalink / raw)
To: devel, mikuback; +Cc: 'Jian J Wang', 'Dandan Bi'
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael
> Kubacki
> 发送时间: 2021年9月9日 11:46
> 收件人: devel@edk2.groups.io
> 抄送: Jian J Wang <jian.j.wang@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Dandan Bi <dandan.bi@intel.com>
> 主题: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration
> improvements and fixes
>
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512
>
> This patch series contains three patches. The first two are for
> relatively minor improvments - a typo fix in function descriptions
> and changing the error level of a debug print. The third patch
> fixes a pointer size mismatch.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>
> Michael Kubacki (3):
> MdeModulePkg/Core/Pei: Fix typo in function descriptions
> MdeModulePkg/Core/Pei: Make migrated PEIM message verbose
> MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam()
>
> MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 13 ++++++++-----
> MdeModulePkg/Core/Pei/PeiMain.h | 2 +-
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> --
> 2.28.0.windows.1
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#80399): https://edk2.groups.io/g/devel/message/80399
> Mute This Topic: https://groups.io/mt/85477360/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* 回复: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes
[not found] ` <16A35CCD00964177.18571@groups.io>
@ 2021-09-16 1:28 ` gaoliming
0 siblings, 0 replies; 6+ messages in thread
From: gaoliming @ 2021-09-16 1:28 UTC (permalink / raw)
To: devel, gaoliming, mikuback; +Cc: 'Jian J Wang', 'Dandan Bi'
Create PR https://github.com/tianocore/edk2/pull/1977
> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 gaoliming
> 发送时间: 2021年9月10日 12:52
> 收件人: devel@edk2.groups.io; mikuback@linux.microsoft.com
> 抄送: 'Jian J Wang' <jian.j.wang@intel.com>; 'Dandan Bi'
> <dandan.bi@intel.com>
> 主题: 回复: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei:
> Migration improvements and fixes
>
> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
>
> > -----邮件原件-----
> > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael
> > Kubacki
> > 发送时间: 2021年9月9日 11:46
> > 收件人: devel@edk2.groups.io
> > 抄送: Jian J Wang <jian.j.wang@intel.com>; Liming Gao
> > <gaoliming@byosoft.com.cn>; Dandan Bi <dandan.bi@intel.com>
> > 主题: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration
> > improvements and fixes
> >
> > From: Michael Kubacki <michael.kubacki@microsoft.com>
> >
> > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3512
> >
> > This patch series contains three patches. The first two are for
> > relatively minor improvments - a typo fix in function descriptions
> > and changing the error level of a debug print. The third patch
> > fixes a pointer size mismatch.
> >
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Liming Gao <gaoliming@byosoft.com.cn>
> > Cc: Dandan Bi <dandan.bi@intel.com>
> > Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> >
> > Michael Kubacki (3):
> > MdeModulePkg/Core/Pei: Fix typo in function descriptions
> > MdeModulePkg/Core/Pei: Make migrated PEIM message verbose
> > MdeModulePkg/Core/Pei: Fix pointer size mismatch in
> EvacuateTempRam()
> >
> > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 13 ++++++++-----
> > MdeModulePkg/Core/Pei/PeiMain.h | 2 +-
> > 2 files changed, 9 insertions(+), 6 deletions(-)
> >
> > --
> > 2.28.0.windows.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#80399):
> https://edk2.groups.io/g/devel/message/80399
> > Mute This Topic: https://groups.io/mt/85477360/4905953
> > Group Owner: devel+owner@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub
> > [gaoliming@byosoft.com.cn]
> > -=-=-=-=-=-=
> >
>
>
>
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-09-16 1:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-09 3:45 [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes Michael Kubacki
2021-09-09 3:45 ` [PATCH v1 1/3] MdeModulePkg/Core/Pei: Fix typo in function descriptions Michael Kubacki
2021-09-09 3:46 ` [PATCH v1 2/3] MdeModulePkg/Core/Pei: Make migrated PEIM message verbose Michael Kubacki
2021-09-09 3:46 ` [PATCH v1 3/3] MdeModulePkg/Core/Pei: Fix pointer size mismatch in EvacuateTempRam() Michael Kubacki
2021-09-10 4:51 ` 回复: [edk2-devel] [PATCH v1 0/3] MdeModulePkg/Core/Pei: Migration improvements and fixes gaoliming
[not found] ` <16A35CCD00964177.18571@groups.io>
2021-09-16 1:28 ` gaoliming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox