From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=sughosh.ganu@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 84CDB2194D387 for ; Sun, 2 Dec 2018 23:21:12 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 135DA165C; Sun, 2 Dec 2018 23:21:12 -0800 (PST) Received: from usa.arm.com (a074948-lin.blr.arm.com [10.162.4.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7F7BC3F614; Sun, 2 Dec 2018 23:21:10 -0800 (PST) From: Sughosh Ganu To: edk2-devel@lists.01.org, Achin Gupta , Jiewen Yao Date: Mon, 3 Dec 2018 12:50:54 +0530 Message-Id: <1543821656-4982-4-git-send-email-sughosh.ganu@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543821656-4982-1-git-send-email-sughosh.ganu@arm.com> References: <1543821656-4982-1-git-send-email-sughosh.ganu@arm.com> Subject: [PATCH 3/5] StandaloneMmPkg: Zero data structure explicitly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 X-List-Received-Date: Mon, 03 Dec 2018 07:21:12 -0000 From: Achin Gupta 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 Signed-off-by: Sughosh Ganu --- 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