From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.2.79; helo=eur02-ve1-obe.outbound.protection.outlook.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20079.outbound.protection.outlook.com [40.107.2.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DEDC52063E31D for ; Fri, 4 May 2018 16:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=o2mvJFUJNb4haJFgtXppAZcmmZoLWt337d/tsD1mg/M=; b=WomaZhOEHUkjklkTPoeG7g1oDwICiN05f9P30kIZI/HjqLYBAcHElxRAwSaepZEGEhsiEuyZRAomfjU7D2bL4KXFGAzYIdLKB5KQJCNjhKLDWIFog8X1A+tSXoB2z6kuchKyXi3la6LquQ4N0os1ekE0FBCjJZ5GsnNT136rl08= Received: from AM4PR0802MB2306.eurprd08.prod.outlook.com (10.172.218.15) by AM4PR0802MB2276.eurprd08.prod.outlook.com (10.172.218.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.735.16; Fri, 4 May 2018 23:31:14 +0000 Received: from AM4PR0802MB2306.eurprd08.prod.outlook.com ([fe80::e117:6f62:6a9b:6be4]) by AM4PR0802MB2306.eurprd08.prod.outlook.com ([fe80::e117:6f62:6a9b:6be4%8]) with mapi id 15.20.0735.016; Fri, 4 May 2018 23:31:13 +0000 From: Supreeth Venkatesh To: Achin Gupta , "jiewen.yao@intel.com" CC: "edk2-devel@lists.01.org" Thread-Topic: [PATCH v1 17/18] StandaloneMmPkg: Add application to test MM communication protocol. Thread-Index: AQHTzbWyRIn6RCDVC0up9XJAhFttRaQZ4McAgASbAqA= Date: Fri, 4 May 2018 23:31:13 +0000 Message-ID: References: <20180406144223.10931-1-supreeth.venkatesh@arm.com> <20180406144223.10931-18-supreeth.venkatesh@arm.com> <20180430200200.GB663@e104320-lin> In-Reply-To: <20180430200200.GB663@e104320-lin> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Supreeth.Venkatesh@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0802MB2276; 7:Xei+pgYT0UwQZdfWWYiMApFrd31bHXh85I1OJzQTLTC3cGTT8aqE8oDjirDMaYDRhiSQVgxRTkoMu+dV4IC9t+lqQIRm91JVI3sguqLGmem22qcJirkcRUR6VfyY6bGvYBa+YNIDfP5aHICkLjAlBaUGDiJffJeIPGhKlmI/UDpTu1nanrLRPAy6oxZBfWBLY/AxYymvd4+60Ji17u3QkYYLJRcg37CZ9hxsmRIz1l5N6EZ0rib3BWQB8Qcsnq2P x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM4PR0802MB2276; x-ms-traffictypediagnostic: AM4PR0802MB2276: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0802MB2276; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0802MB2276; x-forefront-prvs: 06628F7CA4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(39860400002)(396003)(366004)(346002)(376002)(39380400002)(199004)(189003)(13464003)(40434004)(53936002)(81166006)(4326008)(53376002)(7736002)(55016002)(6306002)(9686003)(8936002)(6116002)(2900100001)(3846002)(5250100002)(97736004)(6246003)(68736007)(2501003)(5890100001)(8676002)(25786009)(229853002)(575784001)(72206003)(86362001)(966005)(3660700001)(478600001)(59450400001)(7696005)(6436002)(3280700002)(106356001)(15188155005)(102836004)(26005)(105586002)(11346002)(6506007)(305945005)(33656002)(76176011)(66066001)(110136005)(5660300001)(14454004)(81156014)(316002)(99286004)(74316002)(53546011)(476003)(16799955002)(446003)(2906002)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0802MB2276; H:AM4PR0802MB2306.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: bL8WQ7k9ZL7P2AE1ijyLGAwDx5YOclmZdOLrV0DSRW3j0gUR74Mi62/dEDYnexpbmEAbFWaOfr73AEkAY8Vc/VCQkpOzyoX+1r+A9KhJtYO/+m43GITWxbnFVE3Q4wXMHeVojY9RBst7M3kS5C68xc8zDdMdxBP+fX9A1OsA5qpTUDsWqMnwVVQa2W0XQ7cP spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f6ced4f6-c66b-4321-3a2f-08d5b2172059 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6ced4f6-c66b-4321-3a2f-08d5b2172059 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 May 2018 23:31:13.7472 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2276 Subject: Re: [PATCH v1 17/18] StandaloneMmPkg: Add application to test MM communication protocol. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 23:31:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable My response inline. -----Original Message----- From: Achin Gupta Sent: Monday, April 30, 2018 3:02 PM To: Supreeth Venkatesh Cc: edk2-devel@lists.01.org; michael.d.kinney@intel.com; liming.gao@intel.c= om; jiewen.yao@intel.com; leif.lindholm@linaro.org; ard.biesheuvel@linaro.o= rg; nd Subject: Re: [PATCH v1 17/18] StandaloneMmPkg: Add application to test MM c= ommunication protocol. Hi Supreeth, I agree with Jiewen that these should not be a part of this series. Can you= push these in a separate series? [Supreeth] Jiewen's comment was "they are only for unit test. I do not thin= k we should check in them". I will not send these patches as of now, if you= do need them, Let me know. cheers, Achin On Fri, Apr 06, 2018 at 03:42:22PM +0100, Supreeth Venkatesh wrote: > This patch adds a simple application that uses the MM communication > protocol to pass a copy of the UEFI system table to the MM environment > in the secure world. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Achin Gupta > Signed-off-by: Supreeth Venkatesh > --- > .../Application/MmCommTestApp/MmCommTest.c | 81 ++++++++++++++++= ++++++ > .../Application/MmCommTestApp/MmCommTest.h | 37 ++++++++++ > .../Application/MmCommTestApp/MmCommTest.inf | 57 +++++++++++++++ > 3 files changed, 175 insertions(+) > create mode 100644 > StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.c > create mode 100644 > StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.h > create mode 100644 > StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.inf > > diff --git a/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.c > b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.c > new file mode 100644 > index 0000000000..efbafdde62 > --- /dev/null > +++ b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.c > @@ -0,0 +1,81 @@ > +/** @file > + This sample application demos how to communicate > + with secure partition using MM communication protocol > + > + Copyright (c) 2006 - 2008, Intel Corporation. All rights > + reserved.
Copyright (c) 2016 - 2018, ARM Limited. All rights > + reserved.
> + > + This program and the accompanying materials are licensed and made > + available under the terms and conditions of the BSD License which > + accompanies this distribution. The full text of the license may be > + found at http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > + BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRE= SS OR IMPLIED. > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "MmCommTest.h" > + > +#include > + > +#include > + > +EFI_MM_COMMUNICATION_PROTOCOL *mMmCommunication =3D NULL; > + > +EFI_STATUS > +MmIplNotifyCommTest ( > + VOID > + ) > +{ > + EFI_MM_COMMUNICATE_TEST MmCommTest; > + UINTN Size; > + > + DEBUG ((DEBUG_INFO, "MmIplNotifyCommTest\n")); > + > + CopyGuid (&MmCommTest.HeaderGuid, &gMmCommTestGuid); CopyMem > + (&MmCommTest.Data.EfiSystemTable, gST, sizeof (EFI_SYSTEM_TABLE)); > + MmCommTest.MessageLength =3D sizeof (EFI_MM_COMMUNICATE_TEST_DATA); > + > + // > + // Generate the MM_COMMUNICATE SMC and return the result > + // > + Size =3D sizeof (MmCommTest); > + return mMmCommunication->Communicate (NULL, &MmCommTest, &Size); } > + > +/** > + The user Entry Point for Application. The user code starts with > +this function > + as the real entry point for the application. > + > + @param[in] ImageHandle The firmware allocated handle for the EFI im= age. > + @param[in] SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The entry point is executed successfully. > + @retval other Some error occurs when executing this entry = point. > + > +**/ > +EFI_STATUS > +EFIAPI > +MmCommTestEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + Status =3D gBS->LocateProtocol (&gEfiMmCommunicationProtocolGuid, > + NULL, (VOID **) &mMmCommunication); if (EFI_ERROR (Status)) { > + return Status; > + } > + > + return MmIplNotifyCommTest (); > +} > diff --git a/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.h > b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.h > new file mode 100644 > index 0000000000..8e8305a060 > --- /dev/null > +++ b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.h > @@ -0,0 +1,37 @@ > +/** @file > + GUIDs for MM Event. > + > +Copyright (c) 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
> + > +This program and the accompanying materials are licensed and made > +available under the terms and conditions of the BSD License that accompa= nies this distribution. > +The full text of the license may be found at > +http://opensource.org/licenses/bsd-license.php. > + > +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. > + > +**/ > + > +#ifndef __MM_COMM_TEST_H__ > +#define __MM_COMM_TEST_H__ > + > +#define MM_COMM_TEST_GUID \ > + { 0xa37721e4, 0x8c0b, 0x4bca, { 0xb5, 0xe8, 0xe9, 0x2, 0xa0, 0x25, > +0x51, 0x4e }} > + > +extern EFI_GUID gMmCommTestGuid; > + > +#pragma pack(1) > +typedef struct { > + EFI_SYSTEM_TABLE EfiSystemTable; > +} EFI_MM_COMMUNICATE_TEST_DATA; > + > +typedef struct { > + EFI_GUID HeaderGuid; > + UINTN MessageLength; > + EFI_MM_COMMUNICATE_TEST_DATA Data; > +} EFI_MM_COMMUNICATE_TEST; > +#pragma pack() > + > +#endif > diff --git a/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.inf > b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.inf > new file mode 100644 > index 0000000000..1828cd7e13 > --- /dev/null > +++ b/StandaloneMmPkg/Application/MmCommTestApp/MmCommTest.inf > @@ -0,0 +1,57 @@ > +## @file > +# Sample UEFI Application Reference EDKII Module. > +# > +# This is a sample shell application that will print "UEFI firmware > +version Info!" to the # UEFI Console. > +# > +# It demos how to communicate with secure partition using MM # > +communication protocol. > +# > +# Copyright (c) 2008 - 2014, Intel Corporation. All rights > +reserved.
# Copyright (c) 2016 - 2018, ARM Limited. All rights rese= rved. > +# > +# This program and the accompanying materials # are licensed and > +made available under the terms and conditions of the BSD License # > +which accompanies this distribution. The full text of the license may > +be found at # http://opensource.org/licenses/bsd-license.php > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPR= ESS OR IMPLIED. > +# > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x0001001A > + BASE_NAME =3D MmCommTest > + FILE_GUID =3D 6987936E-ED34-44db-AE97-1FA5E4ED211= 6 > + MODULE_TYPE =3D UEFI_APPLICATION > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D MmCommTestEntryPoint > + > +[Sources] > + MmCommTest.c > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + MdePkg/MdePkg.dec > + StandaloneMmPkg/StandaloneMmPkg.dec > + > +[LibraryClasses] > + ArmSmcLib > + BaseMemoryLib > + DebugLib > + PrintLib > + UefiApplicationEntryPoint > + UefiBootServicesTableLib > + UefiLib > + > +[FeaturePcd] > + > +[Pcd] > + > +[Guids] > + gMmCommTestGuid > + > +[Protocols] > + gEfiMmCommunicationProtocolGuid > -- > 2.16.2 > IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.