public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg
@ 2021-09-16  0:14 Kun Qin
  2021-09-16  0:14 ` [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI Kun Qin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kun Qin @ 2021-09-16  0:14 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Sean Brogan,
	Jian J Wang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629

EFI_PEI_MM_COMMUNICATION_PPI is defined since PI spec v1.5. This patch
series added the interface definition and related GUIDs into MdePkg. 

Given gEfiPeiSmmCommunicationPpiGuid and gEfiPeiMmCommunicationPpiGuid
have the same value, CI build files are also updated accordingly to avoid
build failure caused by duplicate GUIDs.

Patch v1 branch: https://github.com/kuqin12/edk2/tree/mm_communicate_ppi

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Jian J Wang <jian.j.wang@intel.com>

Kun Qin (3):
  MdePkg: MmCommunication: Added definition of MM Communication PPI
  MdePkg: CI YAML: Added new GUID to ignore duplicate list
  MdeModulePkg: CI YAML: Added new GUID to ignore duplicate list

 MdeModulePkg/MdeModulePkg.ci.yaml    |  1 +
 MdePkg/Include/Ppi/MmCommunication.h | 72 ++++++++++++++++++++
 MdePkg/MdePkg.ci.yaml                |  3 +-
 MdePkg/MdePkg.dec                    |  3 +
 4 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 MdePkg/Include/Ppi/MmCommunication.h

-- 
2.32.0.windows.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI
  2021-09-16  0:14 [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg Kun Qin
@ 2021-09-16  0:14 ` Kun Qin
  2021-09-16  0:14 ` [PATCH v1 2/3] MdePkg: CI YAML: Added new GUID to ignore duplicate list Kun Qin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kun Qin @ 2021-09-16  0:14 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Sean Brogan

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629

MM Communication PPI was defined in PI Specification since v1.5. This
change added definition of such PPI and related GUIDs into MdePkg.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
---
 MdePkg/Include/Ppi/MmCommunication.h | 72 ++++++++++++++++++++
 MdePkg/MdePkg.dec                    |  3 +
 2 files changed, 75 insertions(+)

diff --git a/MdePkg/Include/Ppi/MmCommunication.h b/MdePkg/Include/Ppi/MmCommunication.h
new file mode 100644
index 000000000000..7e06da2ec088
--- /dev/null
+++ b/MdePkg/Include/Ppi/MmCommunication.h
@@ -0,0 +1,72 @@
+/** @file
+  EFI MM Communication PPI definition.
+
+  This PPI provides a means of communicating between drivers outside
+  of MM and MMI handlers inside of MM in PEI phase.
+
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) Microsoft Corporation.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+
+#ifndef MM_COMMUNICATION_PPI_H_
+#define MM_COMMUNICATION_PPI_H_
+
+#define EFI_PEI_MM_COMMUNICATION_PPI_GUID \
+  { \
+    0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } \
+  }
+
+typedef struct _EFI_PEI_MM_COMMUNICATION_PPI  EFI_PEI_MM_COMMUNICATION_PPI;
+
+/**
+  Communicates with a registered handler.
+
+  This function provides a service to send and receive messages from a registered PEI service.
+  The EFI_PEI_MM_COMMUNICATION_PPI driver is responsible for doing any of the copies such that
+  the data lives in PEI-service-accessible RAM.
+
+  A given implementation of the EFI_PEI_MM_COMMUNICATION_PPI may choose to use the
+  EFI_MM_CONTROL_PPI for effecting the mode transition, or it may use some other method.
+
+  The agent invoking the communication interface must be physical/virtually 1:1 mapped.
+
+  To avoid confusion in interpreting frames, the CommBuffer parameter should always begin with
+  EFI_MM_COMMUNICATE_HEADER. The header data is mandatory for messages sent into the MM agent.
+
+  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.
+
+  @param[in] This                 The EFI_PEI_MM_COMMUNICATION_PPI instance.
+  @param[in] CommBuffer           Pointer to the buffer to convey into MMRAM.
+  @param[in] 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.
+
+  @retval EFI_SUCCESS             The message was successfully posted.
+  @retval EFI_INVALID_PARAMETER   The buffer was NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_MM_COMMUNICATE)(
+  IN CONST EFI_PEI_MM_COMMUNICATION_PPI     *This,
+  IN OUT VOID                               *CommBuffer,
+  IN OUT UINTN                              *CommSize
+  );
+
+///
+/// EFI MM Communication PPI provides services for communicating between PEIM and a registered
+/// MMI handler.
+///
+struct _EFI_PEI_MM_COMMUNICATION_PPI {
+  EFI_PEI_MM_COMMUNICATE  Communicate;
+};
+
+extern EFI_GUID gEfiPeiMmCommunicationPpiGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index a28a2daaffa8..9cdc915ebae9 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -991,6 +991,9 @@ [Ppis]
   ## Include/Ppi/MmConfiguration.h
   gEfiPeiMmConfigurationPpi       =  { 0xc109319, 0xc149, 0x450e, { 0xa3, 0xe3, 0xb9, 0xba, 0xdd, 0x9d, 0xc3, 0xa4 } }
 
+  ## Include/Ppi/MmCommunication.h
+  gEfiPeiMmCommunicationPpiGuid   =  { 0xae933e1c, 0xcc47, 0x4e38, { 0x8f, 0xe, 0xe2, 0xf6, 0x1d, 0x26, 0x5, 0xdf } }
+
   #
   # PPIs defined in PI 1.7.
   #
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/3] MdePkg: CI YAML: Added new GUID to ignore duplicate list
  2021-09-16  0:14 [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg Kun Qin
  2021-09-16  0:14 ` [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI Kun Qin
@ 2021-09-16  0:14 ` Kun Qin
  2021-09-16  0:14 ` [PATCH v1 3/3] MdeModulePkg: " Kun Qin
  2021-09-17  1:25 ` 回复: [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg gaoliming
  3 siblings, 0 replies; 5+ messages in thread
From: Kun Qin @ 2021-09-16  0:14 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629

SMM Communication PPI GUID from MdeModulePkg is defined the same as MM
Communication PPI GUID from MdePkg, according to PI Spec v1.5 and onward.

After introduction of MM Communication PPI definitions, an update in the
ignore duplicate list is needed to avoid breaking CI build.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
---
 MdePkg/MdePkg.ci.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
index 98eaea1c8248..3ea8eec33152 100644
--- a/MdePkg/MdePkg.ci.yaml
+++ b/MdePkg/MdePkg.ci.yaml
@@ -100,7 +100,8 @@
             "gEfiProcessorSpecificErrorSectionGuid=gEfiIa32X64ProcessorErrorSectionGuid",  ## is this a bug
             "gEfiSmmPeriodicTimerDispatch2ProtocolGuid=gEfiMmPeriodicTimerDispatchProtocolGuid",
             "gEfiPeiMmAccessPpiGuid=gPeiSmmAccessPpiGuid",
-            "gPeiSmmControlPpiGuid=gEfiPeiMmControlPpiGuid"
+            "gPeiSmmControlPpiGuid=gEfiPeiMmControlPpiGuid",
+            "gEfiPeiMmCommunicationPpiGuid=gEfiPeiSmmCommunicationPpiGuid",
             ]
     },
 
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 3/3] MdeModulePkg: CI YAML: Added new GUID to ignore duplicate list
  2021-09-16  0:14 [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg Kun Qin
  2021-09-16  0:14 ` [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI Kun Qin
  2021-09-16  0:14 ` [PATCH v1 2/3] MdePkg: CI YAML: Added new GUID to ignore duplicate list Kun Qin
@ 2021-09-16  0:14 ` Kun Qin
  2021-09-17  1:25 ` 回复: [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg gaoliming
  3 siblings, 0 replies; 5+ messages in thread
From: Kun Qin @ 2021-09-16  0:14 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629

SMM Communication PPI GUID from MdeModulePkg is defined the same as MM
Communication PPI GUID from MdePkg, according to PI Spec v1.5 and onward.

After introduction of MM Communication PPI definitions, an update in the
ignore duplicate list is needed to avoid breaking CI build.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>

Signed-off-by: Kun Qin <kuqin12@gmail.com>
---
 MdeModulePkg/MdeModulePkg.ci.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/MdeModulePkg.ci.yaml b/MdeModulePkg/MdeModulePkg.ci.yaml
index aa304f2ccd5c..b8d15a3e952e 100644
--- a/MdeModulePkg/MdeModulePkg.ci.yaml
+++ b/MdeModulePkg/MdeModulePkg.ci.yaml
@@ -84,6 +84,7 @@
         "IgnoreDuplicates": [
             "gEfiPeiMmAccessPpiGuid=gPeiSmmAccessPpiGuid",
             "gPeiSmmControlPpiGuid=gEfiPeiMmControlPpiGuid",
+            "gEfiPeiMmCommunicationPpiGuid=gEfiPeiSmmCommunicationPpiGuid",
         ]
     },
 
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* 回复: [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg
  2021-09-16  0:14 [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg Kun Qin
                   ` (2 preceding siblings ...)
  2021-09-16  0:14 ` [PATCH v1 3/3] MdeModulePkg: " Kun Qin
@ 2021-09-17  1:25 ` gaoliming
  3 siblings, 0 replies; 5+ messages in thread
From: gaoliming @ 2021-09-17  1:25 UTC (permalink / raw)
  To: 'Kun Qin', devel
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Sean Brogan', 'Jian J Wang'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Kun Qin <kuqin12@gmail.com>
> 发送时间: 2021年9月16日 8:14
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Sean
> Brogan <sean.brogan@microsoft.com>; Jian J Wang <jian.j.wang@intel.com>
> 主题: [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3629
> 
> EFI_PEI_MM_COMMUNICATION_PPI is defined since PI spec v1.5. This patch
> series added the interface definition and related GUIDs into MdePkg.
> 
> Given gEfiPeiSmmCommunicationPpiGuid and
> gEfiPeiMmCommunicationPpiGuid
> have the same value, CI build files are also updated accordingly to avoid
> build failure caused by duplicate GUIDs.
> 
> Patch v1 branch:
> https://github.com/kuqin12/edk2/tree/mm_communicate_ppi
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> 
> Kun Qin (3):
>   MdePkg: MmCommunication: Added definition of MM Communication PPI
>   MdePkg: CI YAML: Added new GUID to ignore duplicate list
>   MdeModulePkg: CI YAML: Added new GUID to ignore duplicate list
> 
>  MdeModulePkg/MdeModulePkg.ci.yaml    |  1 +
>  MdePkg/Include/Ppi/MmCommunication.h | 72 ++++++++++++++++++++
>  MdePkg/MdePkg.ci.yaml                |  3 +-
>  MdePkg/MdePkg.dec                    |  3 +
>  4 files changed, 78 insertions(+), 1 deletion(-)
>  create mode 100644 MdePkg/Include/Ppi/MmCommunication.h
> 
> --
> 2.32.0.windows.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-17  1:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-16  0:14 [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg Kun Qin
2021-09-16  0:14 ` [PATCH v1 1/3] MdePkg: MmCommunication: Added definition of MM Communication PPI Kun Qin
2021-09-16  0:14 ` [PATCH v1 2/3] MdePkg: CI YAML: Added new GUID to ignore duplicate list Kun Qin
2021-09-16  0:14 ` [PATCH v1 3/3] MdeModulePkg: " Kun Qin
2021-09-17  1:25 ` 回复: [PATCH v1 0/3] Add MM Communication PPI definition to MdePkg gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox