From nobody Mon Feb 9 10:48:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85311+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85311+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1641521747; cv=none; d=zohomail.com; s=zohoarc; b=RrGKDNks1KtSAoONyBB84S3x2ThcMtKEDK7FqAhU2MUo7Fz+Tm9qUhuEPKH7Ihbt8zCnXh1MiGi1yVp4M5k7lTsmhXWfiNSQWsn/mhqRjLkLguAO5u94qgMsrxKrgCV4saDAZLjeBp+Gw++bm1qS5jEzUXxwTG+eMmXzB0qZtBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641521747; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=F8duQj0jhqn2xpjQNsH50FI81F/3VQ0r/QlP8xi0vT8=; b=E8taioneupTFh+LYOoCg8yJJ790LpJAXqzYRxD8hS9VRwP4Lne5zWsJfXeOdQ0Sxd8vaIcYOvav3cOSj6QeoIbGIMWpn0urXuVy7vVpIgQ6tlIJltBnjdEwsoBuaUSJdzVWEYX01wZd9SDR5CUA5Ln7UEczcm8CiXATpC8WOV+A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85311+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1641521747214271.91359655384815; Thu, 6 Jan 2022 18:15:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tkMRYY1788612xqlgYe18J2B; Thu, 06 Jan 2022 18:15:46 -0800 X-Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mx.groups.io with SMTP id smtpd.web12.1453.1641521746311083671 for ; Thu, 06 Jan 2022 18:15:46 -0800 X-Received: by mail-pg1-f177.google.com with SMTP id v25so4191655pge.2 for ; Thu, 06 Jan 2022 18:15:46 -0800 (PST) X-Gm-Message-State: vKDix1sKVTUerF3Yz00WCfgpx1787277AA= X-Google-Smtp-Source: ABdhPJwuI2vWSQO11DBs0JCEAfe6s7M8tHhYiuHQFYF8L4ZzLZsDJq0N7yjxGBAjwQukyBlPNT4CMw== X-Received: by 2002:a63:211a:: with SMTP id h26mr54517394pgh.239.1641521745757; Thu, 06 Jan 2022 18:15:45 -0800 (PST) X-Received: from localhost.localdomain ([50.35.74.198]) by smtp.gmail.com with ESMTPSA id j3sm3894875pfc.196.2022.01.06.18.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:15:45 -0800 (PST) From: "Kun Qin" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Hao A Wu , =?UTF-8?q?Marvin=20H=C3=A4user?= , Bret Barkelew , Michael Kubacki Subject: [edk2-devel] [PATCH v4 3/7] MdePkg: MmCommunication: Introduce EFI_MM_COMMUNICATION3_PROTOCOL to MdePkg Date: Thu, 6 Jan 2022 18:15:28 -0800 Message-Id: <20220107021532.1322-4-kuqin12@gmail.com> In-Reply-To: <20220107021532.1322-1-kuqin12@gmail.com> References: <20220107021532.1322-1-kuqin12@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kuqin12@gmail.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1641521746; bh=jrMC5TYuKDF8UnmzojOEozuKLrTe1Ziaavy/hNEBMKY=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=T2UXiBsX/xnkqGjP2AWyqtqeGn/MFlmxgorbBN7l2bw/na6MP4UZroCbXGaPXnFop0q u0cDY+9YEZ6mqgKhOunaarZjdBNdWS1ptqMYlcq6TYS3AEhvi29xr7MGZmfQHrZ/vOPwi xctK+let7yLWY0YIYbGn7qUkFZ4tRaWtIHA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1641522649357100001 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3398 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3430 This change introduces a new definition for MM communicate protocol v3. This protocol will be installed under a new GUID in contrast to exisiting EFI_MM_COMMUNICATION_PROTOCOL. Data communicated to MM through EFI_MM_COMMUNICATION3_PROTOCOL should always start with EFI_MM_COMMUNICATE_HEADER_V3 with its HeaderGuid, Signature and Version fields properly populated. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Hao A Wu Cc: Marvin H=C3=A4user Cc: Bret Barkelew Cc: Michael Kubacki Signed-off-by: Kun Qin --- Notes: v3: - Newly introduced v3 of communicate protocol =20 v4: - Rebased with uncrustify changes. MdePkg/Include/Protocol/MmCommunication3.h | 70 ++++++++++++++++++++ MdePkg/MdePkg.dec | 3 + 2 files changed, 73 insertions(+) diff --git a/MdePkg/Include/Protocol/MmCommunication3.h b/MdePkg/Include/Pr= otocol/MmCommunication3.h new file mode 100644 index 000000000000..0df9e5b875b7 --- /dev/null +++ b/MdePkg/Include/Protocol/MmCommunication3.h @@ -0,0 +1,70 @@ +/** @file + EFI MM Communication Protocol 2 as defined in the PI 1.7 errata A specif= ication. + + This protocol provides a means of communicating between drivers outside = of MM and MMI + handlers inside of MM. + + Copyright (c) 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2019, Arm Limited. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef MM_COMMUNICATION3_H_ +#define MM_COMMUNICATION3_H_ + +#include + +#define EFI_MM_COMMUNICATION3_PROTOCOL_GUID \ + { \ + 0xf7234a14, 0xdf2, 0x46c0, { 0xad, 0x28, 0x90, 0xe6, 0xb8, 0x83, 0xa7,= 0x2f } \ + } + +typedef struct _EFI_MM_COMMUNICATION3_PROTOCOL EFI_MM_COMMUNICATION3_PROTO= COL; + +/** + Communicates with a registered handler. + + This function provides a service to send and receive messages from a reg= istered UEFI service. + + @param[in] This The EFI_MM_COMMUNICATION3_PROTOCOL i= nstance. + @param[in, out] CommBufferPhysical Physical address of the MM communica= tion buffer, of which content must + start with EFI_MM_COMMUNICATE_HEADER= _V3. + @param[in, out] CommBufferVirtual Virtual address of the MM communicat= ion buffer, of which content must + start with EFI_MM_COMMUNICATE_HEADER= _V3. + @param[in, out] CommSize The size of the data buffer being pa= ssed 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 b= e NULL. + + @retval EFI_SUCCESS The message was successfully posted. + @retval EFI_INVALID_PARAMETER CommBufferPhysical was NULL or CommB= ufferVirtual was NULL. + @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM i= mplementation. + If this error is returned, the Messa= geLength field + in the CommBuffer header or the inte= ger pointed by + CommSize, are updated to reflect the= maximum payload + size the implementation can accommod= ate. + @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or C= ommSize parameter, + if not omitted, are in address range= that cannot be + accessed by the MM environment. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_MM_COMMUNICATE3)( + IN CONST EFI_MM_COMMUNICATION3_PROTOCOL *This, + IN OUT VOID *CommBufferPhysical, + IN OUT VOID *CommBufferVirtual, + IN OUT UINTN *CommSize OPTIONAL + ); + +/// +/// EFI MM Communication Protocol provides runtime services for communicat= ing +/// between DXE drivers and a registered MMI handler. +/// +struct _EFI_MM_COMMUNICATION3_PROTOCOL { + EFI_MM_COMMUNICATE3 Communicate; +}; + +extern EFI_GUID gEfiMmCommunication3ProtocolGuid; + +#endif diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 11c08e617511..8c61661e4ee7 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1357,6 +1357,9 @@ [Protocols] ## Include/Protocol/MmCommunication2.h gEfiMmCommunication2ProtocolGuid =3D { 0x378daedc, 0xf06b, 0x4446, { 0x= 83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 }} =20 + ## Include/Protocol/MmCommunication3.h + gEfiMmCommunication3ProtocolGuid =3D { 0xf7234a14, 0xdf2, 0x46c0, { 0xa= d, 0x28, 0x90, 0xe6, 0xb8, 0x83, 0xa7, 0x2f }} + # # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1 # --=20 2.34.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85311): https://edk2.groups.io/g/devel/message/85311 Mute This Topic: https://groups.io/mt/88253682/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-