* [PATCH 1/5] StandaloneMmPkg: Add missing dependency on PL011UartClockLib
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
@ 2018-12-03 7:20 ` Sughosh Ganu
2018-12-03 7:20 ` [PATCH 2/5] StandaloneMmPkg: Enforce alignment check for AArch64 Sughosh Ganu
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sughosh Ganu @ 2018-12-03 7:20 UTC (permalink / raw)
To: edk2-devel, Achin Gupta, Jiewen Yao
From: Achin Gupta <achin.gupta@arm.com>
This patch fixes the dependency PL011UartLib has on PL011UartClockLib by
including its implementation path in the StandaloneMm DSC file.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
StandaloneMmPkg/StandaloneMmPkg.dsc | 1 +
1 file changed, 1 insertion(+)
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index c6ddb35b8993..84de1ab0f13a 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -67,6 +67,7 @@ [LibraryClasses.AARCH64]
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
+ PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
# ARM PL011 UART Driver
SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] StandaloneMmPkg: Enforce alignment check for AArch64
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
2018-12-03 7:20 ` [PATCH 1/5] StandaloneMmPkg: Add missing dependency on PL011UartClockLib Sughosh Ganu
@ 2018-12-03 7:20 ` Sughosh Ganu
2018-12-03 7:20 ` [PATCH 3/5] StandaloneMmPkg: Zero data structure explicitly Sughosh Ganu
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sughosh Ganu @ 2018-12-03 7:20 UTC (permalink / raw)
To: edk2-devel, Achin Gupta, Jiewen Yao
From: Achin Gupta <achin.gupta@arm.com>
On AArch64, Standalone MM during the SEC phase runs in S-EL0 with
SCTLR_EL1.A=1. This patch adds the -mstrict-align compiler flag to
ensure that the generated code is compliant with the runtime
alignment checks.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
StandaloneMmPkg/StandaloneMmPkg.dsc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 84de1ab0f13a..3470e1102cc3 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -128,4 +128,5 @@ [Components.AARCH64]
#
###################################################################################################
[BuildOptions.AARCH64]
-GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp
+GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
+GCC:*_*_*_CC_FLAGS = -mstrict-align
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] StandaloneMmPkg: Zero data structure explicitly
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
2018-12-03 7:20 ` [PATCH 1/5] StandaloneMmPkg: Add missing dependency on PL011UartClockLib Sughosh Ganu
2018-12-03 7:20 ` [PATCH 2/5] StandaloneMmPkg: Enforce alignment check for AArch64 Sughosh Ganu
@ 2018-12-03 7:20 ` Sughosh Ganu
2018-12-03 7:20 ` [PATCH 4/5] StandaloneMmPkg: Replace dependency on ArmMmuLib Sughosh Ganu
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Sughosh Ganu @ 2018-12-03 7:20 UTC (permalink / raw)
To: edk2-devel, Achin Gupta, Jiewen Yao
From: Achin Gupta <achin.gupta@arm.com>
Introduction of the -mstrict-align flag results in GCC attempting
to use memset to zero out the InitMmFoundationSvcArgs structure.
In the absence of this C library function, this patch explicitly
zeroes this data structure prior to use.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
index 20fd0d1f34ba..05ed6c8dd0b5 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
@@ -224,7 +224,7 @@ _ModuleEntryPoint (
{
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo;
- ARM_SVC_ARGS InitMmFoundationSvcArgs = {0};
+ ARM_SVC_ARGS InitMmFoundationSvcArgs;
EFI_STATUS Status;
UINT32 SectionHeaderOffset;
UINT16 NumberOfSections;
@@ -299,6 +299,7 @@ _ModuleEntryPoint (
DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64) CpuDriverEntryPoint));
finish:
+ ZeroMem (&InitMmFoundationSvcArgs, sizeof(InitMmFoundationSvcArgs));
InitMmFoundationSvcArgs.Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
InitMmFoundationSvcArgs.Arg1 = Status;
DelegatedEventLoop (&InitMmFoundationSvcArgs);
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] StandaloneMmPkg: Replace dependency on ArmMmuLib
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
` (2 preceding siblings ...)
2018-12-03 7:20 ` [PATCH 3/5] StandaloneMmPkg: Zero data structure explicitly Sughosh Ganu
@ 2018-12-03 7:20 ` Sughosh Ganu
2018-12-03 7:20 ` [PATCH 5/5] StandaloneMmPkg: Update dependency on PeCoffExtraActionLib Sughosh Ganu
2018-12-09 16:20 ` [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Achin Gupta
5 siblings, 0 replies; 7+ messages in thread
From: Sughosh Ganu @ 2018-12-03 7:20 UTC (permalink / raw)
To: edk2-devel, Achin Gupta, Jiewen Yao
From: Achin Gupta <achin.gupta@arm.com>
Use StandaloneMmMmuLib instead of ArmMmuLib in StandaloneMmPkg for AArch64
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
StandaloneMmPkg/StandaloneMmPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 3470e1102cc3..412702272c95 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -62,7 +62,7 @@ [LibraryClasses]
[LibraryClasses.AARCH64]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
- ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuStandaloneMmCoreLib.inf
+ StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] StandaloneMmPkg: Update dependency on PeCoffExtraActionLib
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
` (3 preceding siblings ...)
2018-12-03 7:20 ` [PATCH 4/5] StandaloneMmPkg: Replace dependency on ArmMmuLib Sughosh Ganu
@ 2018-12-03 7:20 ` Sughosh Ganu
2018-12-09 16:20 ` [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Achin Gupta
5 siblings, 0 replies; 7+ messages in thread
From: Sughosh Ganu @ 2018-12-03 7:20 UTC (permalink / raw)
To: edk2-devel, Achin Gupta, Jiewen Yao
From: Achin Gupta <achin.gupta@arm.com>
Replace DebugPeCoffExtraActionLib with StandaloneMmExtraActionLib
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
---
StandaloneMmPkg/StandaloneMmPkg.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 412702272c95..ea4153f567a8 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -65,7 +65,7 @@ [LibraryClasses.AARCH64]
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
- PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
+ PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
# ARM PL011 UART Driver
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes
2018-12-03 7:20 [PATCH 0/5] StandaloneMmPkg: Miscellaneous fixes Sughosh Ganu
` (4 preceding siblings ...)
2018-12-03 7:20 ` [PATCH 5/5] StandaloneMmPkg: Update dependency on PeCoffExtraActionLib Sughosh Ganu
@ 2018-12-09 16:20 ` Achin Gupta
5 siblings, 0 replies; 7+ messages in thread
From: Achin Gupta @ 2018-12-09 16:20 UTC (permalink / raw)
To: Sughosh Ganu; +Cc: edk2-devel@lists.01.org, Jiewen Yao, nd
Hi Sughosh,
On Mon, Dec 03, 2018 at 12:50:51PM +0530, Sughosh Ganu wrote:
> Miscellaneous fixes in StandaloneMmPkg code.
>
> This patcheset is to be applied on top of the following patchset
> "StandaloneMM: Update permissions for Standalone MM drivers memory area"
>
>
> Achin Gupta (5):
> StandaloneMmPkg: Add missing dependency on PL011UartClockLib
> StandaloneMmPkg: Enforce alignment check for AArch64
> StandaloneMmPkg: Zero data structure explicitly
> StandaloneMmPkg: Replace dependency on ArmMmuLib
> StandaloneMmPkg: Update dependency on PeCoffExtraActionLib
>
> StandaloneMmPkg/StandaloneMmPkg.dsc | 8 +++++---
> StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 3 ++-
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> --
> 2.7.4
>
>
Reviewed-by: Achin Gupta <achin.gupta@arm.com>
Pushed as 4ceb9c01f9b2..0d1fb6cc8a15
^ permalink raw reply [flat|nested] 7+ messages in thread