public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sughosh Ganu <sughosh.ganu@arm.com>
To: edk2-devel@lists.01.org, Achin Gupta <achin.gupta@arm.com>,
	Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH 3/5] StandaloneMmPkg: Zero data structure explicitly
Date: Mon,  3 Dec 2018 12:50:54 +0530	[thread overview]
Message-ID: <1543821656-4982-4-git-send-email-sughosh.ganu@arm.com> (raw)
In-Reply-To: <1543821656-4982-1-git-send-email-sughosh.ganu@arm.com>

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



  parent reply	other threads:[~2018-12-03  7:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2018-12-03  7:20 ` [PATCH 4/5] StandaloneMmPkg: Replace dependency on ArmMmuLib 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543821656-4982-4-git-send-email-sughosh.ganu@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox