* [Patch 0/3] Add new PCD PcdInitValueInTempStack
@ 2017-11-02 2:59 Liming Gao
2017-11-02 2:59 ` [Patch 1/3] MdeModulePkg: " Liming Gao
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Liming Gao @ 2017-11-02 2:59 UTC (permalink / raw)
To: edk2-devel
This PCD repalces the hard code 0x5AA55AA5 in the different modules.
Liming Gao (3):
MdeModulePkg: Add new PCD PcdInitValueInTempStack
MdeModulePkg: Update PeiCore consumes PCD to get the init value in
temp stack
Nt32Pkg: Update SecMain consumes PCD to get the init value in temp
stack
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 7 +------
MdeModulePkg/Core/Pei/PeiMain.inf | 1 +
MdeModulePkg/MdeModulePkg.dec | 6 ++++++
Nt32Pkg/Sec/SecMain.c | 2 +-
Nt32Pkg/Sec/SecMain.inf | 1 +
5 files changed, 10 insertions(+), 7 deletions(-)
--
2.11.0.windows.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
2017-11-02 2:59 [Patch 0/3] Add new PCD PcdInitValueInTempStack Liming Gao
@ 2017-11-02 2:59 ` Liming Gao
2017-11-03 1:14 ` Zeng, Star
2017-11-02 2:59 ` [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack Liming Gao
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Liming Gao @ 2017-11-02 2:59 UTC (permalink / raw)
To: edk2-devel
https://bugzilla.tianocore.org/show_bug.cgi?id=740
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/MdeModulePkg.dec | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 20a07be96e..b69dd24ce5 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -883,6 +883,12 @@
# @Prompt Enable NULL address detection.
gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|0x0|UINT8|0x30001050
+ ## Init Value in Temp Stack to be shared between SEC and PEI_CORE <BR><BR>
+ # SEC fills the full temp stack with this values. When switch stack, PeiCore can check
+ # this value in the temp stack to know how many stack has been used.
+ # @Prompt Init Value in Temp Stack
+ gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack|0x5AA55AA5|UINT32|0x30001051
+
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
--
2.11.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack
2017-11-02 2:59 [Patch 0/3] Add new PCD PcdInitValueInTempStack Liming Gao
2017-11-02 2:59 ` [Patch 1/3] MdeModulePkg: " Liming Gao
@ 2017-11-02 2:59 ` Liming Gao
2017-11-02 2:59 ` [Patch 3/3] Nt32Pkg: Update SecMain " Liming Gao
2017-11-02 23:06 ` [Patch 0/3] Add new PCD PcdInitValueInTempStack Ard Biesheuvel
3 siblings, 0 replies; 8+ messages in thread
From: Liming Gao @ 2017-11-02 2:59 UTC (permalink / raw)
To: edk2-devel
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 7 +------
MdeModulePkg/Core/Pei/PeiMain.inf | 1 +
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 38299c5d98..467066a0bf 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -15,11 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "PeiMain.h"
-///
-/// temporary memory is filled with this initial value during SEC phase
-///
-#define INIT_CAR_VALUE 0x5AA55AA5
-
/**
Discover all Peims and optional Apriori file in one FV. There is at most one
@@ -680,7 +675,7 @@ PeiCheckAndSwitchStack (
for (StackPointer = (UINT32*)SecCoreData->StackBase;
(StackPointer < (UINT32*)((UINTN)SecCoreData->StackBase + SecCoreData->StackSize)) \
- && (*StackPointer == INIT_CAR_VALUE);
+ && (*StackPointer == PcdGet32 (PcdInitValueInTempStack));
StackPointer ++);
DEBUG ((DEBUG_INFO, "Temp Stack : BaseAddress=0x%p Length=0x%X\n", SecCoreData->StackBase, (UINT32)SecCoreData->StackSize));
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf
index 21ce2be778..7d9cdaa2f0 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.inf
+++ b/MdeModulePkg/Core/Pei/PeiMain.inf
@@ -116,6 +116,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnS3Boot ## CONSUMES
gEfiMdeModulePkgTokenSpaceGuid.PcdShadowPeimOnBoot ## CONSUMES
+ gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack ## CONSUMES
# [BootMode]
# S3_RESUME ## SOMETIMES_CONSUMES
--
2.11.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Patch 3/3] Nt32Pkg: Update SecMain consumes PCD to get the init value in temp stack
2017-11-02 2:59 [Patch 0/3] Add new PCD PcdInitValueInTempStack Liming Gao
2017-11-02 2:59 ` [Patch 1/3] MdeModulePkg: " Liming Gao
2017-11-02 2:59 ` [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack Liming Gao
@ 2017-11-02 2:59 ` Liming Gao
2017-11-02 23:06 ` [Patch 0/3] Add new PCD PcdInitValueInTempStack Ard Biesheuvel
3 siblings, 0 replies; 8+ messages in thread
From: Liming Gao @ 2017-11-02 2:59 UTC (permalink / raw)
To: edk2-devel
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
Nt32Pkg/Sec/SecMain.c | 2 +-
Nt32Pkg/Sec/SecMain.inf | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/Nt32Pkg/Sec/SecMain.c b/Nt32Pkg/Sec/SecMain.c
index 80539faa33..74871a67c8 100644
--- a/Nt32Pkg/Sec/SecMain.c
+++ b/Nt32Pkg/Sec/SecMain.c
@@ -263,7 +263,7 @@ Returns:
for (StackPointer = (UINTN*) (UINTN) InitialStackMemory;
StackPointer < (UINTN*) ((UINTN)InitialStackMemory + (SIZE_T) InitialStackMemorySize);
StackPointer ++) {
- *StackPointer = 0x5AA55AA5;
+ *StackPointer = PcdGet32 (PcdInitValueInTempStack);
}
SecPrint (" SEC passing in %d bytes of temp RAM to PEI\n", InitialStackMemorySize);
diff --git a/Nt32Pkg/Sec/SecMain.inf b/Nt32Pkg/Sec/SecMain.inf
index 423a3c7c48..f2e1520b6d 100644
--- a/Nt32Pkg/Sec/SecMain.inf
+++ b/Nt32Pkg/Sec/SecMain.inf
@@ -65,6 +65,7 @@
gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareFdSize
gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain
gEfiNt32PkgTokenSpaceGuid.PcdWinNtFirmwareVolume
+ gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack
[BuildOptions]
MSFT:*_*_IA32_DLINK_FLAGS == /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib Advapi32.lib
--
2.11.0.windows.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch 0/3] Add new PCD PcdInitValueInTempStack
2017-11-02 2:59 [Patch 0/3] Add new PCD PcdInitValueInTempStack Liming Gao
` (2 preceding siblings ...)
2017-11-02 2:59 ` [Patch 3/3] Nt32Pkg: Update SecMain " Liming Gao
@ 2017-11-02 23:06 ` Ard Biesheuvel
3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2017-11-02 23:06 UTC (permalink / raw)
To: Liming Gao; +Cc: edk2-devel@lists.01.org
On 2 November 2017 at 02:59, Liming Gao <liming.gao@intel.com> wrote:
> This PCD repalces the hard code 0x5AA55AA5 in the different modules.
>
> Liming Gao (3):
> MdeModulePkg: Add new PCD PcdInitValueInTempStack
> MdeModulePkg: Update PeiCore consumes PCD to get the init value in
> temp stack
> Nt32Pkg: Update SecMain consumes PCD to get the init value in temp
> stack
>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 7 +------
> MdeModulePkg/Core/Pei/PeiMain.inf | 1 +
> MdeModulePkg/MdeModulePkg.dec | 6 ++++++
> Nt32Pkg/Sec/SecMain.c | 2 +-
> Nt32Pkg/Sec/SecMain.inf | 1 +
> 5 files changed, 10 insertions(+), 7 deletions(-)
>
> --
> 2.11.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
2017-11-02 2:59 ` [Patch 1/3] MdeModulePkg: " Liming Gao
@ 2017-11-03 1:14 ` Zeng, Star
2017-11-03 7:24 ` Gao, Liming
0 siblings, 1 reply; 8+ messages in thread
From: Zeng, Star @ 2017-11-03 1:14 UTC (permalink / raw)
To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star
The MdeModulePkg.uni also needs to be updated for this new PCD, right?
Thanks,
Star
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Liming Gao
Sent: Thursday, November 2, 2017 10:59 AM
To: edk2-devel@lists.01.org
Subject: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
https://bugzilla.tianocore.org/show_bug.cgi?id=740
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdeModulePkg/MdeModulePkg.dec | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 20a07be96e..b69dd24ce5 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -883,6 +883,12 @@
# @Prompt Enable NULL address detection.
gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|0x0|UINT8|0x30001050
+ ## Init Value in Temp Stack to be shared between SEC and PEI_CORE <BR><BR>
+ # SEC fills the full temp stack with this values. When switch stack, PeiCore can check
+ # this value in the temp stack to know how many stack has been used.
+ # @Prompt Init Value in Temp Stack
+ gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack|0x5AA55AA5|UINT32|0x30001051
+
[PcdsFixedAtBuild, PcdsPatchableInModule]
## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function
--
2.11.0.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
2017-11-03 1:14 ` Zeng, Star
@ 2017-11-03 7:24 ` Gao, Liming
2017-11-03 7:27 ` Zeng, Star
0 siblings, 1 reply; 8+ messages in thread
From: Gao, Liming @ 2017-11-03 7:24 UTC (permalink / raw)
To: Zeng, Star, edk2-devel@lists.01.org
Yes. Thanks for your reminder. I will add it into MdeModulePkg.uni.
>-----Original Message-----
>From: Zeng, Star
>Sent: Friday, November 03, 2017 9:15 AM
>To: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: RE: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD
>PcdInitValueInTempStack
>
>The MdeModulePkg.uni also needs to be updated for this new PCD, right?
>
>
>Thanks,
>Star
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Liming Gao
>Sent: Thursday, November 2, 2017 10:59 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD
>PcdInitValueInTempStack
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=740
>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Liming Gao <liming.gao@intel.com>
>---
> MdeModulePkg/MdeModulePkg.dec | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/MdeModulePkg/MdeModulePkg.dec
>b/MdeModulePkg/MdeModulePkg.dec
>index 20a07be96e..b69dd24ce5 100644
>--- a/MdeModulePkg/MdeModulePkg.dec
>+++ b/MdeModulePkg/MdeModulePkg.dec
>@@ -883,6 +883,12 @@
> # @Prompt Enable NULL address detection.
>
>gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|
>0x0|UINT8|0x30001050
>
>+ ## Init Value in Temp Stack to be shared between SEC and PEI_CORE
><BR><BR>
>+ # SEC fills the full temp stack with this values. When switch stack, PeiCore
>can check
>+ # this value in the temp stack to know how many stack has been used.
>+ # @Prompt Init Value in Temp Stack
>+
>gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack|0x5AA55AA5|
>UINT32|0x30001051
>+
> [PcdsFixedAtBuild, PcdsPatchableInModule]
> ## Dynamic type PCD can be registered callback function for Pcd setting
>action.
> # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum
>number of callback function
>--
>2.11.0.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
2017-11-03 7:24 ` Gao, Liming
@ 2017-11-03 7:27 ` Zeng, Star
0 siblings, 0 replies; 8+ messages in thread
From: Zeng, Star @ 2017-11-03 7:27 UTC (permalink / raw)
To: Gao, Liming, edk2-devel@lists.01.org; +Cc: Zeng, Star
With that added, Reviewed-by: Star Zeng <star.zeng@intel.com> to this patch series.
Thanks,
Star
-----Original Message-----
From: Gao, Liming
Sent: Friday, November 3, 2017 3:24 PM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
Subject: RE: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD PcdInitValueInTempStack
Yes. Thanks for your reminder. I will add it into MdeModulePkg.uni.
>-----Original Message-----
>From: Zeng, Star
>Sent: Friday, November 03, 2017 9:15 AM
>To: Gao, Liming <liming.gao@intel.com>; edk2-devel@lists.01.org
>Cc: Zeng, Star <star.zeng@intel.com>
>Subject: RE: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD
>PcdInitValueInTempStack
>
>The MdeModulePkg.uni also needs to be updated for this new PCD, right?
>
>
>Thanks,
>Star
>-----Original Message-----
>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
>Liming Gao
>Sent: Thursday, November 2, 2017 10:59 AM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch 1/3] MdeModulePkg: Add new PCD
>PcdInitValueInTempStack
>
>https://bugzilla.tianocore.org/show_bug.cgi?id=740
>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Liming Gao <liming.gao@intel.com>
>---
> MdeModulePkg/MdeModulePkg.dec | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/MdeModulePkg/MdeModulePkg.dec
>b/MdeModulePkg/MdeModulePkg.dec index 20a07be96e..b69dd24ce5 100644
>--- a/MdeModulePkg/MdeModulePkg.dec
>+++ b/MdeModulePkg/MdeModulePkg.dec
>@@ -883,6 +883,12 @@
> # @Prompt Enable NULL address detection.
>
>gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask|
>0x0|UINT8|0x30001050
>
>+ ## Init Value in Temp Stack to be shared between SEC and PEI_CORE
><BR><BR>
>+ # SEC fills the full temp stack with this values. When switch stack,
>+ PeiCore
>can check
>+ # this value in the temp stack to know how many stack has been used.
>+ # @Prompt Init Value in Temp Stack
>+
>gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack|0x5AA55AA5|
>UINT32|0x30001051
>+
> [PcdsFixedAtBuild, PcdsPatchableInModule]
> ## Dynamic type PCD can be registered callback function for Pcd
>setting action.
> # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum
>number of callback function
>--
>2.11.0.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-03 7:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-02 2:59 [Patch 0/3] Add new PCD PcdInitValueInTempStack Liming Gao
2017-11-02 2:59 ` [Patch 1/3] MdeModulePkg: " Liming Gao
2017-11-03 1:14 ` Zeng, Star
2017-11-03 7:24 ` Gao, Liming
2017-11-03 7:27 ` Zeng, Star
2017-11-02 2:59 ` [Patch 2/3] MdeModulePkg: Update PeiCore consumes PCD to get the init value in temp stack Liming Gao
2017-11-02 2:59 ` [Patch 3/3] Nt32Pkg: Update SecMain " Liming Gao
2017-11-02 23:06 ` [Patch 0/3] Add new PCD PcdInitValueInTempStack Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox