From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.5.61; helo=eur03-ve1-obe.outbound.protection.outlook.com; envelope-from=achin.gupta@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50061.outbound.protection.outlook.com [40.107.5.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 94F7521F38843 for ; Thu, 12 Oct 2017 10:34:13 -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=JWNViIc+Az6eZFWPOxuYU0pSRskC1umJsFXRpozc0VI=; b=aV43ZpBWS2QD4v+Yx1sJC883MviVrzVBBl9XnrbTB0IkJJlLOSUlsLZ2DisXB+VLxSIlCtzQKnCpHNitU/xnEAB3GfFHhKv2Qp79DGDBDJXR8prSVCKTQOZAwfrjPoj/GRVKpmxHPtzUogWAVSpL70sZ1d4TsSBWkzM97ipcNFM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Achin.Gupta@arm.com; Received: from e104320-lin (217.140.96.140) by AM4PR08MB2691.eurprd08.prod.outlook.com (2603:10a6:205:c::28) 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:37:38 +0000 Date: Thu, 12 Oct 2017 18:38:29 +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: <20171012173829.GT26498@e104320-lin> References: <20171012171352.45168-1-supreeth.venkatesh@arm.com> MIME-Version: 1.0 In-Reply-To: <20171012171352.45168-1-supreeth.venkatesh@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM5PR06CA0001.eurprd06.prod.outlook.com (2603:10a6:206:2::14) To AM4PR08MB2691.eurprd08.prod.outlook.com (2603:10a6:205:c::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89489485-7026-42ad-b2a4-08d51197ef0e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:AM4PR08MB2691; X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB2691; 3:uWOKVGto10y12ac9qBtuu+LKc9cUCQImFzHXEqichDs0rhVmBCKTtXNTkSHCwn0jsSsADCx81MRucNGcXZ9Aur0bDbtxA3sixmBWv2GhK5iAIQT5K0P6gbhcDmXYxksiT0Tn1NaAu8N1djHui6cY2lGLOxOdefL1RZ7Iwei/lqUonMFvYzO6u8IKQsR+cYS7FPceZa/IHT0r42B/dQQ/JHvdWVPALbXwxNQOpocJeMr+kd9urj5cfUXhhEd8uchx; 25:YCeefFC0WjbVXce4aW2xL/M8VzKpmQCIAzQvAElJjfCQLZtHgD3uqEIh63uRzmjoejivEB7Ydx4r6xMJEUu1wAQEqUT4+zZyOdRtVsHdf0T7DOq7+iZQ3TNPXHk91Maw08TnEpujiOI1U1kSYxH2LvpoXKqrotMn3k2c3TMeZM2IneSF8n7Q96lddwPs+u/t09/Y/d91K22Waah+vSP5siFNqGSdLf6XmKAdWLBxZ7TIlMM474ugzQat/fz4G9kS15A+W47GWa9wsto14GG2KOc+gJ4dvqtVkQnMEJVHO8EAveakWVMfy95dJIPXgYfmiLxz3TjZAE/e4LCASSJKIg==; 31:Fhe+75daBujAvtVrd5pUUxrcHNm/ess263VeTAwCzWx+TQz04oH4mg++53/r7AJG3RwVu0UzLy1m1baGGpx/ihT54FvGPbVm3fAji4jya7ELRxqAGW3L0KVObCjKHJ2oji1MXPzluyzYh0vZgRQdu7/vYsJFVnry8t2mFTuRddtJOvii9aKNZv7I8amgEvE8D+Ry52YTqfY/zo773eST912rlgpvM4903OYyhVIzMkg= X-MS-TrafficTypeDiagnostic: AM4PR08MB2691: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB2691; 20:zsm6PMl1EIJJgkIIJobwVEGGnUpMyvWyICPd0jiWPDoQ7yF2ycXnb0AMxVzolXMV5RzknYXP+foUf2oDuGeiTQRWJvEPitQa/Md6MQO2P+M7CutQzxyhvRP0HtC+a1fsTPMFx+CIahQYwD9ruoy+K3I3Tn8cKn6ZsquBeRycas0=; 4:kV1WSJsO8KH0i+uhfJekUK0edwMCFchxB86o2s4PEVBQ0X9MeoHizYWKgIQpWct1huJOiF41YGH+WKMWdZnBQNFm0fD17HlO7hGzD2jEFlyUiO43TQ6He/ECwWk+LP4T2025PzFpMj+pl0auTbhQSU7LmbeeRtp4BdTRhJgFIfkCdH3ZBWBlUswXOhdc7dkr8zw2dUe092fOVOiU1vzPX6plFKFHHVdHGZQmoAC5Ue2q0M3JXNKVD3S3fZv2OvVPExyR8BU43oHG/5WSpW8oA9qoohXDLu/KZYHkK4ON1Yw= 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:AM4PR08MB2691; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM4PR08MB2691; X-Forefront-PRVS: 04583CED1A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(189002)(24454002)(189998001)(72206003)(2950100002)(33716001)(305945005)(47776003)(7736002)(16526018)(97736004)(3846002)(66066001)(33656002)(6116002)(6636002)(6666003)(8936002)(55016002)(25786009)(9686003)(83506001)(81156014)(4326008)(50466002)(229853002)(8676002)(81166006)(86362001)(316002)(2906002)(6246003)(105586002)(6862004)(5660300001)(58126008)(106356001)(68736007)(6496005)(53936002)(16586007)(1076002)(101416001)(50986999)(54356999)(76176999)(478600001)(23726003)(18370500001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2691; 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: =?us-ascii?Q?1; AM4PR08MB2691; 23:elZOhgKBMTXEHuRKcTv+iEyRFZGSH4GwuURKkTOhd?= =?us-ascii?Q?kb4ixiHYMY8riZggjo/DnTwPLhxpsw5b/3xURM0fStdMiyHJKiwm9DPiVVdR?= =?us-ascii?Q?SDiyB8z/dwlvKrtXu5+nbEgxX3CLDa9FMdvm2Bw3H8QLniQ/Ujjn9TQQ0QPK?= =?us-ascii?Q?h35qIPA0oZueTB5ppqGfEqDSPKXZc0VRKACUn5NYD26HF1A1a31Z8hnKIJIX?= =?us-ascii?Q?DED6TKGt5rqXXECiHi1O8zuc4aTlIjrWhTPDzvqgxlWXJYKYVA9yjBnHxgh3?= =?us-ascii?Q?GEp03yN5WdxtxGVYKM0x6HpaQ5R35xk9jQRRJrnULK26zACn21itmThqA2Q+?= =?us-ascii?Q?/Wrdj6mxF11cLWOQMZfj9D3Qf9qTiLvtnC/nMHprSvfGuJLYGPhcdrLRSnIo?= =?us-ascii?Q?td4zz9Q2UU3oUm+PesbTalMQRPyP1fjY7jmzwx83Ml18QIQZL9epk7FsmCkJ?= =?us-ascii?Q?LL5V29d5EWyH9D3CXWj35LlqMBBh3egWwjXzLfcAe64HibGjpOY+Bhso0fVG?= =?us-ascii?Q?ZIiMyHnRtRKyzU6rTziIc8+AQYHlqhvp9SJXXmB5MndvVAV/zPbp3rNmVSYN?= =?us-ascii?Q?lD7nQUQThyCi8zx2F0nbRkidNprkobb2ZC+2rw58NHnt3ODeqVsVvo7rrpPB?= =?us-ascii?Q?ka2z1+QANG3sM9kFrvlbS6wThwLsGR0VWrUblFAvx6SGXXc+SLf2iiDHyz4b?= =?us-ascii?Q?/zre5zC/2ts9sknJ0fAPvpoZE4dKjAw3HpjziilNQikU1UhV1fhIKxdEaPFM?= =?us-ascii?Q?YKAXpwpVvu/G6VfTfh7siLLzN0BZPN6yJAfGx99Ok7X/BPwWRUV+XIdaF21I?= =?us-ascii?Q?By//NmgnjRl3zPCFr1nIM79ON4i99r8JF80T36coAYaFd+n9odYmqtHxe6Ew?= =?us-ascii?Q?kWq5aYVQ/G1Q4f3fyjnpnyv3ucDDkrq6SSF0B3KSD5dhFqEbeNXlhORDhTLK?= =?us-ascii?Q?KgtisCfF9NUvmphqsFpVyDEhrDWbiuay4AvSdY2QCCjoPH5gMlTyPPU/Czfx?= =?us-ascii?Q?vjtz7BUiinWAVQrFbT4eX2a/qNf+H8ljsbPtCaV2dGXv+iEDin2nw8Xo3H10?= =?us-ascii?Q?KblN/+2qgF8jB47bNldFxSjJIRjQkJ89YSSbfFNamR19l9lPNVFPBQWEs1j5?= =?us-ascii?Q?rN0QtRTcSxcG5r+FII9yxfpiF5WE6mmEffUi37u4vGog9y2UXpeB1bCiVxEb?= =?us-ascii?Q?K7yBr4PuKKHX7twpRVfRYdZAVGOwYBUGsB9vbPGjmNjO2wOeLFMK7JQz9rIT?= =?us-ascii?Q?JwGWUxyJp01jdP4dWc+avTP7odvK9dBoAAkKNxE?= X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB2691; 6:EWM5SWGeFxtw2ZkpHsPgRvPsdZbm0iyTiI6A70IRsjD97wP4Kj9k1Yqju0CXC+4yuC4mic2NbIfjFxLK7zFf1vr54cC7n7I7b1vjTXUBL7yl804yW+4BVO/MeDfDoIxNjMH6qkyCVuH3UTmioh0fS6uYDLFb7gm8NvZ5C3IQj1x+s8+2apyqM0BM+4dkfVe3CRnClzkWl12TYeVS1SSsNRwVt2L32RSfpe2b8AiA7EVgxiaI1BGn/qT4wOy/eOA5jwdPuZTzr+2VRjRkkmr1K19fPmbQQrThoEWHzSVUnKChl9BCo4si6Za2xFeQ7tK0JcYLH2f1GT++cWVr5VoSew==; 5:O0lCmocMPK5kfEeD32C7Ffh+J6rJ8QfpYo5coLM+s+fq9xQ92t70txvotbV0wgBT3t2tH1k+AcOWHbc+oIelf0/SUpWvaURdrf4G5ftsXKjLoPmaQZh3HezqgOki8Aa9wKGD8XW9WOTlgXbUns+Big==; 24:Y0ly4wp96TzgYDR/iICVn68YmNc5cZrkJO+suyVZt7PVRVuedcdsGETcJ69nIaeVAMb/lrHl6ZXMFLKAstLAZDR4GsmY2SRXvuPoji8T2HI=; 7:/VvNUtYr48wpmIrgiV2nkXT8eL0SN0LW55qEKJC+Ti9kj2DMBeDEdSQ+51AvHuNa610mEC+nXWOjw+XEuc3kI5E7h5QfU8dqhcb2r79nvj5nSeaRRgtau9OswiSoYcGVelLGWaZ9yAVx4GtKdo0VtiU8WYCZntD69EHAnolPQeR7NL+5LBNuu0+H9CGGgC1uyq2mjWXVNNgwY0zaqmfDOhxWVj/MxKej0hUOsMQQXNA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 17:37:38.9838 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2691 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:34:14 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Supreeth, Could you acknowledge me as a contributor in the relevant patches and repost? 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 >