From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.1.86; helo=eur02-he1-obe.outbound.protection.outlook.com; envelope-from=achin.gupta@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10086.outbound.protection.outlook.com [40.107.1.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0951421F38824 for ; Thu, 12 Oct 2017 10:47:40 -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=omIF4wP5w8cJZXpARVp2KRiI1GtUAKJu8T7+fDCeOVg=; b=C7UNOHBIlMKrnDo3x93Tvq5ZViQB9Yn3p8ppoQ1Qa0Tw6FiXgEUJiDGmijG9QZpcy0dXpLMZ8eO6F9aN/MBpxc3FSiMCmGNgC3aaMOOJqBrVhNlE2O1Cr5luZNX0zoyQOU/FSefwOeKPP81P+pmo3kXerylKIdD6kT/tqO4Px0c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; Received: from e104320-lin (217.140.96.140) by AM4PR08MB2689.eurprd08.prod.outlook.com (2603:10a6:205:c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 17:51:08 +0000 Date: Thu, 12 Oct 2017 18:51:58 +0100 From: Achin Gupta To: Supreeth Venkatesh Cc: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, nd@arm.com Message-ID: <20171012175158.GW26498@e104320-lin> References: <20171012171352.45168-1-supreeth.venkatesh@arm.com> <20171012173829.GT26498@e104320-lin> <1507830193.3189.6.camel@arm.com> MIME-Version: 1.0 In-Reply-To: <1507830193.3189.6.camel@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0202CA0022.eurprd02.prod.outlook.com (2603:10a6:200:89::32) To AM4PR08MB2689.eurprd08.prod.outlook.com (2603:10a6:205:c::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28aa8938-0a4a-4caa-b804-08d51199d146 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:AM4PR08MB2689; X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB2689; 3:MI4EyLgxmuJ48+csdKZhyil6fsyQG3yLsedq4zoa7Xb8CKO8PK/g0nVgE99E0uH47Fom3Ghqxac75GBQ1YmYbQmFHvUhHOrcV7yNZXTfkey4MxM6IdU8U+/lez1euUXhZgIcgjL9i3Y/reZ6kL0jgI9ZDMvOE5OGGmFIcYRTULd8VBUQFPa9A5RwOr8gFxAGPT0q6RPo6DGLymisawHilR6H1k/DipMMpskhvZOkDWKc71vZUKYPDayPMfHxrJHd; 25:Z0TcpBxhlCMdCBhlbSFtMYMqhp+YxpyUR1PJcTkkJlF5kfxlmX0TAquDalt3BiTd5wtN+Myr4lPP5CdI2etVwkBKzuGIZ03YWu3vY3Yl6853op6JdK2xJFzxnNamSUgQmYNyRIAm4+7u0Oe05DdWTjkRU2ijnFtv3282O6XTuPYWqxMcC3JmQi4PVM8ruRZRGxExOvbiyCy3QAG93EZnMBd5QpDJEQutk+zr/RFF9uxFIHmEVDD97ibOlq44zpp/IYMGBiOcEOxS5PlUmlK1hc26DMQ9OxDJMzAVW4DPdNmjdU2vHJNu1heAOLudOf8Nv87UL4S+A5S8eVF9O1unvA==; 31:pzxhlDmEhL/JWz5RlxKznXK7uqAx4+2FrLL+3oePLjbcpjmUy4C8t+1cXp8TZFHzkQRAl+7IbSm7cZI9dI39PUdVUSyXQG5UMTg0HlqR9BuGpuAmffspXrka1nn8ZRq8RchxAf8F3uyxlcMub89l8qDCT2tHWl3bXo5rLEVPRlhp+j0u0z481+2r7pjoqiUHksQYbd6rjOJHKCuQiZt06m8QIw2ybYT7T7A9YaMd9qg= X-MS-TrafficTypeDiagnostic: AM4PR08MB2689: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB2689; 20:RBR+S8nbcPJJY2BuBhqOZu1aPA9FQ4R0q+ux0LjRQt98/riHAXjkacb6g7ljwAKvYs0aJsUIBIVS8sgK1w+mVhCCogJ7DlOHi1MqTMg1APtWccJtGZ8An5+UyjV+VRdLxgMQoeSwxsEmRc0U6zB/P3YlsxVU8lkVgeCyJF0h3P0=; 4:/k/vX0XtMAIYIKQU2tIxwr94hXol/pYJoLlBQH+NR19Mzos2NIjRynajm5R7ig+8j625OAlaJQBtnCwFc6e43YcLdKwAEkiJyE1dfRU2KWdmo9dltvmADC7R0fo4v4hzr8wJvgYuOy4h/+JE6pzdHbCmkjx5SBtz6ultHDImGoayP1r789Ao+bm0u1t+oe3zUTmbd5pvFWQZyJA4UxcG+VqxVq5FTjro4vpcVKSHw8gLNtjZWyfd6WTCI3v/jsNjt+DXxWWIFoNAUs7TDO2suMm/nxxYj0kHyTAi6MZnWeY= X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM4PR08MB2689; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR08MB2689; X-Forefront-PRVS: 04583CED1A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(377424004)(24454002)(199003)(189002)(54356999)(76176999)(50986999)(8936002)(53936002)(81156014)(6666003)(2950100002)(8676002)(81166006)(7736002)(33656002)(101416001)(305945005)(55016002)(9686003)(6636002)(5660300001)(478600001)(6116002)(229853002)(66066001)(97736004)(25786009)(33716001)(4001150100001)(72206003)(47776003)(189998001)(3846002)(105586002)(23756003)(106356001)(1076002)(50466002)(2870700001)(2906002)(83506001)(86362001)(58126008)(6246003)(68736007)(6862004)(16526018)(6496005)(4326008)(316002)(18370500001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2689; H:e104320-lin; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1; AM4PR08MB2689; 23:yL2/cQ4c1EDeSaCBt6ssCOiIcBh8AfXyi2cwX5Y?= =?iso-8859-1?Q?P7H4ZtNG+Mstiv/OSklpttJzOOmqqu/VoQyohWE4faH5IlyVH5wVfWymCk?= =?iso-8859-1?Q?+fX7LtYYI2E8HP0hwuGmw2flr3+Z7uwohnV2CvWwCMqPI55SDhtTITcOHV?= =?iso-8859-1?Q?ZHMA0cpCDlrLBm7hzhzD4UuThjZAMRlLZuhG2+aD3TpV8w7gnSwXpSjWyZ?= =?iso-8859-1?Q?3SNY/2kAucZ2/2wg7j9QoBIBUdIsrk5++X+EY4LsHYvfmm7UKkpXSaKB1l?= =?iso-8859-1?Q?F68ozKp2bl2s74Z2AocRoDHyGawF101K/Pd/1oF2x1s06rCNlsUPhUdP8K?= =?iso-8859-1?Q?vEFPK/C6mwUXpNGBnRriZYUROLYGcN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pGLckfVh77o3Zm8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 17:51:08.0128 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2689 Subject: Re: [PATCH v1 0/3] *** EFI_MM_COMMUNICATION_PROTOCOL *** X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 17:47:41 -0000 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu, Oct 12, 2017 at 12:43:13PM -0500, Supreeth Venkatesh wrote: > On Thu, 2017-10-12 at 18:38 +0100, Achin Gupta wrote: > > Hi Supreeth, > > > > Could you acknowledge me as a contributor in the relevant patches and > > repost? > Can sure do as done in previous patches. However, Since I wanted you to > review as well the latest changes, I was not sure whether co-author can > be reviewer as well. I can add you as co-author in the next patchset, > if that is what you prefer. Yes I would prefer that! Thanks! Achin >    > > > > cheers, > > Achin > > > > On Thu, Oct 12, 2017 at 06:13:49PM +0100, Supreeth Venkatesh wrote: > > > > > > *** > > > PI v1.5 Specification Volume 4 defines Management Mode Core > > > Interface > > > and defines EFI_MM_COMMUNICATION_PROTOCOL. This protocol provides a > > > means of communicating between drivers outside of MM and MMI > > > handlers inside of MM. > > > > > > EFI_MM_COMMUNICATION_PROTOCOL > > > Summary > > >   This protocol provides a means of communicating between drivers > > > outside of MM and MMI > > >   handlers inside of MM. > > > > > > GUID > > >   #define EFI_MM_COMMUNICATION_PROTOCOL_GUID \ > > >   { 0xc68ed8e2, 0x9dc6, 0x4cbd, 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, > > > 0xc3, 0x32 } > > > > > > Prototype > > >   typedef struct _EFI_MM_COMMUNICATION_PROTOCOL { > > >   EFI_MM_COMMUNICATE Communicate; > > >   } EFI_MM_COMMUNICATION_PROTOCOL; > > > > > > Members > > > Communicate > > >   Sends/receives a message for a registered handler. See the > > > Communicate() > > >   function description. > > > > > > Description > > >   This protocol provides runtime services for communicating between > > > DXE drivers and a registered > > >   MMI handler. > > > > > > EFI_MM_COMMUNICATION_PROTOCOL.Communicate() > > > Summary > > >   Communicates with a registered handler. > > > > > > Prototype > > >   typedef > > >   EFI_STATUS > > >   (EFIAPI *EFI_MM_COMMUNICATE) ( > > >   IN CONST EFI_MM_COMMUNICATION_PROTOCOL *This, > > >   IN OUT VOID *CommBuffer, > > >   IN OUT UINTN *CommSize OPTIONAL > > >   ); > > > > > > Parameters > > >   This - The EFI_MM_COMMUNICATION_PROTOCOL instance. > > >   CommBuffer - Pointer to the buffer to convey into MMRAM. > > >   CommSize - The size of the data buffer being passed in. On exit, > > > the size of data being returned. > > >                      Zero if the handler does not wish to reply > > > with any data. This parameter is optional > > >                      and may be NULL. > > > > > > Description > > >   This function provides a service to send and receive messages > > > from a registered UEFI service. The EFI_MM_COMMUNICATION_PROTOCOL > > > driver is responsible for doing any of the > > >   copies such that the data lives in boot-service-accessible RAM. > > >   A given implementation of the EFI_MM_COMMUNICATION_PROTOCOL may > > > choose to use the EFI_MM_CONTROL_PROTOCOL for effecting the mode > > > transition, or it may use some other method. > > >   The agent invoking the communication interface at runtime may be > > > virtually mapped. The MM infrastructure code and handlers, on the > > > other hand, execute in physical mode. As a result, the non-MM > > > agent, > > >   which may be executing in the virtual-mode OS context (as a > > > result of an OS invocation of the UEFI SetVirtualAddressMap() > > > service), should use a contiguous memory buffer with a physical > > > address before > > >   invoking this service. If the virtual address of the buffer is > > > used, the MM Driver may not know how to do the appropriate virtual- > > > to-physical conversion. > > >   To avoid confusion in interpreting frames, the CommunicateBuffer > > > parameter should always begin with EFI_MM_COMMUNICATE_HEADER, which > > > is defined in Related Definitions below. > > >   The header data is mandatory for messages sent into the MM agent. > > >   If the CommSize parameter is omitted the MessageLength field in > > > the EFI_MM_COMMUNICATE_HEADER, > > >   in conjunction with the size of the header itself, can be used to > > > ascertain the total size of the communication payload. > > >   If the MessageLength is zero, or too large for the MM > > > implementation to manage, the MM implementation must update the > > > MessageLength to reflect the size of the Data buffer that it can > > > tolerate. > > >   If the CommSize parameter is passed into the call, but the > > > integer it points to, has a value of 0, then this must be updated > > > to reflect the maximum size of the CommBuffer that the > > > implementation can tolerate. > > >   Once inside of MM, the MM infrastructure will call all registered > > > handlers with the same HandlerType as the GUID specified by > > > HeaderGuid and the CommBuffer pointing to Data. > > >   This function is not reentrant. > > >   The standard header is used at the beginning of the > > > EFI_MM_INITIALIATION_HEADER structure during MM initialization. See > > > "Related Definitions" below for more information. > > > > > > Related Definitions > > >   typedef struct { > > >   EFI_GUID HeaderGuid; > > >   UINTN MessageLength; > > >   UINT8 Data[ANYSIZE_ARRAY]; > > >   } EFI_MM_COMMUNICATE_HEADER; > > > > > >   HeaderGuid - Allows for disambiguation of the message format. > > > Type EFI_GUID is defined in > > >                        InstallProtocolInterface() in the UEFI > > > Specification. > > >   MessageLength - Describes the size of Data (in bytes) and does > > > not include the size of the header. > > >   Data - Designates an array of bytes that is MessageLength in > > > size. > > > > > > Status Codes Returned > > >   EFI_SUCCESS - The message was successfully posted. > > >   EFI_INVALID_PARAMETER - The buffer was NULL. > > >   EFI_BAD_BUFFER_SIZE - The buffer is too large for the MM > > > implementation. If this error is > > >                                            returned, the > > > MessageLength field in the CommBuffer > > >                                            header or the integer > > > pointed by CommSize, are updated to reflect > > >                                            the maximum payload size > > > the implementation can accommodate. > > >                                            See the function > > > description above for more details. > > >   EFI_ACCESS_DENIED - The CommunicateBuffer parameter or CommSize > > >                                         parameter, if not omitted, > > > are in address range that cannot be > > >                                         accessed by the MM > > > environment. > > > > > > This patchset implements it on AARCH64 Platform. > > > *** > > > > > > Supreeth Venkatesh (3): > > >   ArmPkg/Drivers: Add EFI_MM_COMMUNICATION_PROTOCOL DXE driver. > > >   ArmPkg/Drivers: Add ArmMmCommunication Driver information file. > > >   ArmPkg: Add PCDs needed for MM communication driver. > > > > > >  ArmPkg/ArmPkg.dec                                  |   3 + > > >  .../Drivers/MmCommunicationDxe/MmCommunication.c   | 314 > > > +++++++++++++++++++++ > > >  .../Drivers/MmCommunicationDxe/MmCommunication.inf |  50 ++++ > > >  3 files changed, 367 insertions(+) > > >  create mode 100644 > > > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c > > >  create mode 100644 > > > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf > > > > > > -- > > > 2.14.1 > > >