public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/7] New implementation of MM communicate for standalone MM
@ 2019-12-06 15:29 Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 1/7] MdePkg: introduce MM communicate 2 protocol Ard Biesheuvel
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

This series implements the changes proposed by Mantis ticket 1993, which
describes how we need to modify the MM communicate protocol to make it
compatible with standalone MM based DXE_RUNTIME_DRIVER MM client using
virtually remapped memory.

These changes have been accepted as errata for PI spec v1.7

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Achin Gupta <achin.gupta@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>

Ard Biesheuvel (7):
  MdePkg: introduce MM communicate 2 protocol
  MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
  ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
  MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
  MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
    protocol
  MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
    protocol
  StandaloneMmPkg: switch to MM communicate 2 protocol

 .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
 .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
 .../Application/VariableInfo/VariableInfo.c   | 19 +++--
 .../Application/VariableInfo/VariableInfo.inf |  2 +-
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
 MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
 .../FaultTolerantWriteSmmCommon.h             |  2 +-
 .../FaultTolerantWriteSmmDxe.c                | 25 +++---
 .../FaultTolerantWriteSmmDxe.h                |  2 +-
 .../FaultTolerantWriteSmmDxe.inf              |  4 +-
 .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
 .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
 MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
 MdePkg/MdePkg.dec                             |  7 ++
 StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
 .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
 17 files changed, 254 insertions(+), 94 deletions(-)
 create mode 100644 MdePkg/Include/Protocol/MmCommunication2.h

-- 
2.17.1


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

* [PATCH 1/7] MdePkg: introduce MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 2/7] MdeModulePkg/SmmIpl: expose " Ard Biesheuvel
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Add the protocol definition of the MM communicate 2 protocol,
which is introduced in version 1.7 errata A of the PI spec.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdePkg/Include/Protocol/MmCommunication2.h | 69 ++++++++++++++++++++
 MdePkg/MdePkg.dec                          |  7 ++
 2 files changed, 76 insertions(+)

diff --git a/MdePkg/Include/Protocol/MmCommunication2.h b/MdePkg/Include/Protocol/MmCommunication2.h
new file mode 100644
index 000000000000..05f56dcae53e
--- /dev/null
+++ b/MdePkg/Include/Protocol/MmCommunication2.h
@@ -0,0 +1,69 @@
+/** @file
+  EFI MM Communication Protocol 2 as defined in the PI 1.7 errata A specification.
+
+  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.<BR>
+  Copyright (c) 2019, Arm Limited. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _MM_COMMUNICATION2_H_
+#define _MM_COMMUNICATION2_H_
+
+#include <Protocol/MmCommunication.h>
+
+#define EFI_MM_COMMUNICATION2_PROTOCOL_GUID \
+  { \
+    0x378daedc, 0xf06b, 0x4446, { 0x83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 } \
+  }
+
+typedef struct _EFI_MM_COMMUNICATION2_PROTOCOL  EFI_MM_COMMUNICATION2_PROTOCOL;
+
+/**
+  Communicates with a registered handler.
+
+  This function provides a service to send and receive messages from a registered UEFI service.
+
+  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
+  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
+  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
+  @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.
+                                 This parameter is optional and may be NULL.
+
+  @retval EFI_SUCCESS            The message was successfully posted.
+  @retval EFI_INVALID_PARAMETER  CommBufferPhysical was NULL or CommBufferVirtual was NULL.
+  @retval 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.
+  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
+                                 if not omitted, are in address range that cannot be
+                                 accessed by the MM environment.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MM_COMMUNICATE2)(
+  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
+  IN OUT VOID                               *CommBufferPhysical,
+  IN OUT VOID                               *CommBufferVirtual,
+  IN OUT UINTN                              *CommSize OPTIONAL
+  );
+
+///
+/// EFI MM Communication Protocol provides runtime services for communicating
+/// between DXE drivers and a registered MMI handler.
+///
+struct _EFI_MM_COMMUNICATION2_PROTOCOL {
+  EFI_MM_COMMUNICATE2  Communicate;
+};
+
+extern EFI_GUID gEfiMmCommunication2ProtocolGuid;
+
+#endif
+
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index d022cc5e3ef2..93037e0e6c61 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1276,6 +1276,13 @@ [Protocols]
   ## Include/Protocol/SpiSmmNorFlash.h
   gEfiSpiSmmNorFlashProtocolGuid         = { 0xaab18f19, 0xfe14, 0x4666, { 0x86, 0x04, 0x87, 0xff, 0x6d, 0x66, 0x2c, 0x9a }}
 
+  #
+  # Protocols defined in PI 1.7.
+  #
+
+  ## Include/Protocol/MmCommunication2.h
+  gEfiMmCommunication2ProtocolGuid  = { 0x378daedc, 0xf06b, 0x4446, { 0x83, 0x14, 0x40, 0xab, 0x93, 0x3c, 0x87, 0xa3 }}
+
   #
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1
   #
-- 
2.17.1


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

* [PATCH 2/7] MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 1/7] MdePkg: introduce MM communicate 2 protocol Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 16:01   ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 3/7] ArmPkg/MmCommunicationDxe: expose MM Communicate " Ard Biesheuvel
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

The MM communicate 2 protocol was introduced to factor out the mismatch
between traditional MM, which requires the physical address of the MM
buffer to be passed, and standalone MM, which copies the MM communicate
buffer data into a separate buffer, requiring the virtual address. For
this reason, MM communicate 2 carries both addresses, allowing the
implementation to decide which address it needs.

This hides this implementation detail from the callers of the protocol,
which simply passes both addresses without having to reason about what the
implementation of the protocol actually needs.

Note that the old version of the protocol is retained, in order to support
existing implementations that don't require this flexibility.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   | 79 ++++++++++++++++++++
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf |  1 +
 2 files changed, 80 insertions(+)

diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
index 1cf8c93227a3..d86b8b4a6a29 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -10,6 +10,7 @@
 
 #include <Protocol/SmmBase2.h>
 #include <Protocol/SmmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 #include <Protocol/SmmAccess2.h>
 #include <Protocol/SmmConfiguration.h>
 #include <Protocol/SmmControl2.h>
@@ -118,6 +119,39 @@ SmmCommunicationCommunicate (
   IN OUT UINTN                             *CommSize OPTIONAL
   );
 
+/**
+  Communicates with a registered handler.
+
+  This function provides a service to send and receive messages from a registered UEFI service.
+
+  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
+  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
+  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
+  @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.
+                                 This parameter is optional and may be NULL.
+
+  @retval EFI_SUCCESS            The message was successfully posted.
+  @retval EFI_INVALID_PARAMETER  The CommBuffer was NULL.
+  @retval 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.
+  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
+                                 if not omitted, are in address range that cannot be
+                                 accessed by the MM environment.
+
+**/
+EFI_STATUS
+EFIAPI
+SmmCommunicationMmCommunicate2 (
+  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
+  IN OUT VOID                               *CommBufferPhysical,
+  IN OUT VOID                               *CommBufferVirtual,
+  IN OUT UINTN                              *CommSize OPTIONAL
+  );
+
 /**
   Event notification that is fired every time a gEfiSmmConfigurationProtocol installs.
 
@@ -240,6 +274,13 @@ EFI_SMM_COMMUNICATION_PROTOCOL  mSmmCommunication = {
   SmmCommunicationCommunicate
 };
 
+//
+// PI 1.7 MM Communication Protocol 2 instance
+//
+EFI_MM_COMMUNICATION2_PROTOCOL  mMmCommunication2 = {
+  SmmCommunicationMmCommunicate2
+};
+
 //
 // SMM Core Private Data structure that contains the data shared between
 // the SMM IPL and the SMM Core.
@@ -576,6 +617,44 @@ SmmCommunicationCommunicate (
   return (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
 }
 
+/**
+  Communicates with a registered handler.
+
+  This function provides a service to send and receive messages from a registered UEFI service.
+
+  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
+  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
+  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
+  @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.
+                                 This parameter is optional and may be NULL.
+
+  @retval EFI_SUCCESS            The message was successfully posted.
+  @retval EFI_INVALID_PARAMETER  The CommBuffer was NULL.
+  @retval 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.
+  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
+                                 if not omitted, are in address range that cannot be
+                                 accessed by the MM environment.
+
+**/
+EFI_STATUS
+EFIAPI
+SmmCommunicationMmCommunicate2 (
+  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
+  IN OUT VOID                               *CommBufferPhysical,
+  IN OUT VOID                               *CommBufferVirtual,
+  IN OUT UINTN                              *CommSize OPTIONAL
+  )
+{
+  return SmmCommunicationCommunicate (&mSmmCommunication,
+                                      CommBufferPhysical,
+                                      CommSize);
+}
+
 /**
   Event notification that is fired when GUIDed Event Group is signaled.
 
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
index b6b1bbcdac51..0a05d593522e 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
@@ -50,6 +50,7 @@ [LibraryClasses]
 [Protocols]
   gEfiSmmBase2ProtocolGuid                      ## PRODUCES
   gEfiSmmCommunicationProtocolGuid              ## PRODUCES
+  gEfiMmCommunication2ProtocolGuid              ## PRODUCES
   gEfiSmmAccess2ProtocolGuid                    ## CONSUMES
   ## NOTIFY
   ## CONSUMES
-- 
2.17.1


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

* [PATCH 3/7] ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 1/7] MdePkg: introduce MM communicate 2 protocol Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 2/7] MdeModulePkg/SmmIpl: expose " Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 4/7] MdeModulePkg/VariableInfo: switch to MM communicate " Ard Biesheuvel
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Implement the new MmCommunication2 protocol which supports the use
of standalone MM at runtime inside an address space that has been
virtually remapped by the OS.

Note that the implementation of the old MM Communicate protocol is
removed: it never worked correctly so there is no point in keeping it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c   | 79 +++++++++-----------
 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf |  6 +-
 2 files changed, 40 insertions(+), 45 deletions(-)

diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
index d06dcc4d2080..dc2af35f8617 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2016-2018, ARM Limited. All rights reserved.
+  Copyright (c) 2016-2019, ARM Limited. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -16,7 +16,7 @@
 #include <Library/UefiBootServicesTableLib.h>
 #include <Library/UefiRuntimeServicesTableLib.h>
 
-#include <Protocol/MmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 
 #include <IndustryStandard/ArmStdSmc.h>
 
@@ -39,39 +39,34 @@ STATIC EFI_HANDLE  mMmCommunicateHandle;
 /**
   Communicates with a registered handler.
 
-  This function provides an interface to send and receive messages to the
-  Standalone MM environment on behalf of UEFI services.  This function is part
-  of the MM Communication Protocol that may be called in physical mode prior to
-  SetVirtualAddressMap() and in virtual mode after SetVirtualAddressMap().
+  This function provides a service to send and receive messages from a registered UEFI service.
 
-  @param[in]      This                The EFI_MM_COMMUNICATION_PROTOCOL
-                                      instance.
-  @param[in, out] CommBuffer          A pointer to the buffer to convey
-                                      into MMRAM.
-  @param[in, out] CommSize            The size of the data buffer being
-                                      passed in. This is optional.
+  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
+  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
+  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
+  @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.
+                                 This parameter is optional and may be NULL.
+
+  @retval EFI_SUCCESS            The message was successfully posted.
+  @retval EFI_INVALID_PARAMETER  CommBufferPhysical was NULL or CommBufferVirtual was NULL.
+  @retval 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.
+  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
+                                 if not omitted, are in address range that cannot be
+                                 accessed by the MM environment.
 
-  @retval EFI_SUCCESS                 The message was successfully posted.
-  @retval EFI_INVALID_PARAMETER       The CommBuffer was NULL.
-  @retval EFI_BAD_BUFFER_SIZE         The buffer size is incorrect 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.
-  @retval EFI_ACCESS_DENIED           The CommunicateBuffer parameter
-                                      or CommSize parameter, if not omitted,
-                                      are in address range that cannot be
-                                      accessed by the MM environment
 **/
-STATIC
 EFI_STATUS
 EFIAPI
-MmCommunicationCommunicate (
-  IN CONST EFI_MM_COMMUNICATION_PROTOCOL  *This,
-  IN OUT VOID                             *CommBuffer,
-  IN OUT UINTN                            *CommSize OPTIONAL
+MmCommunication2Communicate (
+  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
+  IN OUT VOID                               *CommBufferPhysical,
+  IN OUT VOID                               *CommBufferVirtual,
+  IN OUT UINTN                              *CommSize OPTIONAL
   )
 {
   EFI_MM_COMMUNICATE_HEADER   *CommunicateHeader;
@@ -87,11 +82,11 @@ MmCommunicationCommunicate (
   //
   // Check parameters
   //
-  if (CommBuffer == NULL) {
+  if (CommBufferVirtual == NULL) {
     return EFI_INVALID_PARAMETER;
   }
 
-  CommunicateHeader = CommBuffer;
+  CommunicateHeader = CommBufferVirtual;
   // CommBuffer is a mandatory parameter. Hence, Rely on
   // MessageLength + Header to ascertain the
   // total size of the communication payload rather than
@@ -136,7 +131,7 @@ MmCommunicationCommunicate (
   CommunicateSmcArgs.Arg1 = 0;
 
   // Copy Communication Payload
-  CopyMem ((VOID *)mNsCommBuffMemRegion.VirtualBase, CommBuffer, BufferSize);
+  CopyMem ((VOID *)mNsCommBuffMemRegion.VirtualBase, CommBufferVirtual, BufferSize);
 
   // comm_buffer_address (64-bit physical address)
   CommunicateSmcArgs.Arg2 = (UINTN)mNsCommBuffMemRegion.PhysicalBase;
@@ -149,7 +144,7 @@ MmCommunicationCommunicate (
 
   switch (CommunicateSmcArgs.Arg0) {
   case ARM_SMC_MM_RET_SUCCESS:
-    ZeroMem (CommBuffer, BufferSize);
+    ZeroMem (CommBufferVirtual, BufferSize);
     // On successful return, the size of data being returned is inferred from
     // MessageLength + Header.
     CommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *)mNsCommBuffMemRegion.VirtualBase;
@@ -158,7 +153,7 @@ MmCommunicationCommunicate (
                  sizeof (CommunicateHeader->MessageLength);
 
     CopyMem (
-      CommBuffer,
+      CommBufferVirtual,
       (VOID *)mNsCommBuffMemRegion.VirtualBase,
       BufferSize
       );
@@ -191,8 +186,8 @@ MmCommunicationCommunicate (
 //
 // MM Communication Protocol instance
 //
-EFI_MM_COMMUNICATION_PROTOCOL  mMmCommunication = {
-  MmCommunicationCommunicate
+STATIC EFI_MM_COMMUNICATION2_PROTOCOL  mMmCommunication2 = {
+  MmCommunication2Communicate
 };
 
 /**
@@ -275,7 +270,7 @@ GetMmCompatibility ()
 **/
 EFI_STATUS
 EFIAPI
-MmCommunicationInitialize (
+MmCommunication2Initialize (
   IN EFI_HANDLE         ImageHandle,
   IN EFI_SYSTEM_TABLE  *SystemTable
   )
@@ -325,9 +320,9 @@ MmCommunicationInitialize (
   // Install the communication protocol
   Status = gBS->InstallProtocolInterface (
                   &mMmCommunicateHandle,
-                  &gEfiMmCommunicationProtocolGuid,
+                  &gEfiMmCommunication2ProtocolGuid,
                   EFI_NATIVE_INTERFACE,
-                  &mMmCommunication
+                  &mMmCommunication2
                   );
   if (EFI_ERROR(Status)) {
     DEBUG ((DEBUG_ERROR, "MmCommunicationInitialize: "
@@ -351,8 +346,8 @@ MmCommunicationInitialize (
 
   gBS->UninstallProtocolInterface (
          mMmCommunicateHandle,
-         &gEfiMmCommunicationProtocolGuid,
-         &mMmCommunication
+         &gEfiMmCommunication2ProtocolGuid,
+         &mMmCommunication2
          );
 
 CleanAddedMemorySpace:
diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
index 450fc9bb5414..9612cfbe5b6c 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
@@ -2,7 +2,7 @@
 #
 #  DXE MM Communicate driver
 #
-#  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -14,7 +14,7 @@ [Defines]
   FILE_GUID                      = 09EE81D3-F15E-43F4-85B4-CB9873DA5D6B
   MODULE_TYPE                    = DXE_RUNTIME_DRIVER
   VERSION_STRING                 = 1.0
-  ENTRY_POINT                    = MmCommunicationInitialize
+  ENTRY_POINT                    = MmCommunication2Initialize
 
 #
 # The following is for reference only and not required by
@@ -40,7 +40,7 @@ [LibraryClasses]
   UefiDriverEntryPoint
 
 [Protocols]
-  gEfiMmCommunicationProtocolGuid              ## PRODUCES
+  gEfiMmCommunication2ProtocolGuid             ## PRODUCES
 
 [Pcd.common]
   gArmTokenSpaceGuid.PcdMmBufferBase
-- 
2.17.1


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

* [PATCH 4/7] MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2019-12-06 15:29 ` [PATCH 3/7] ArmPkg/MmCommunicationDxe: expose MM Communicate " Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 5/7] MdeModulePkg/FaultTolerantWriteSmmDxe: " Ard Biesheuvel
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Switch to the new MM communicate 2 protocol which supports both
traditional and standalone MM.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdeModulePkg/Application/VariableInfo/VariableInfo.c   | 19 +++++++++++--------
 MdeModulePkg/Application/VariableInfo/VariableInfo.inf |  2 +-
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Application/VariableInfo/VariableInfo.c b/MdeModulePkg/Application/VariableInfo/VariableInfo.c
index c04ba182132f..a7df365b5895 100644
--- a/MdeModulePkg/Application/VariableInfo/VariableInfo.c
+++ b/MdeModulePkg/Application/VariableInfo/VariableInfo.c
@@ -20,10 +20,10 @@
 #include <Guid/VariableFormat.h>
 #include <Guid/SmmVariableCommon.h>
 #include <Guid/PiSmmCommunicationRegionTable.h>
-#include <Protocol/SmmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 #include <Protocol/SmmVariable.h>
 
-EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication = NULL;
+EFI_MM_COMMUNICATION2_PROTOCOL  *mMmCommunication2 = NULL;
 
 /**
   This function get the variable statistics data from SMM variable driver.
@@ -41,7 +41,7 @@ EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication = NULL;
 EFI_STATUS
 EFIAPI
 GetVariableStatisticsData (
-  IN OUT  EFI_SMM_COMMUNICATE_HEADER  *SmmCommunicateHeader,
+  IN OUT  EFI_MM_COMMUNICATE_HEADER   *SmmCommunicateHeader,
   IN OUT  UINTN                       *SmmCommunicateSize
   )
 {
@@ -49,12 +49,15 @@ GetVariableStatisticsData (
   SMM_VARIABLE_COMMUNICATE_HEADER     *SmmVariableFunctionHeader;
 
   CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
-  SmmCommunicateHeader->MessageLength = *SmmCommunicateSize - OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data);
+  SmmCommunicateHeader->MessageLength = *SmmCommunicateSize - OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
 
   SmmVariableFunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *) &SmmCommunicateHeader->Data[0];
   SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_STATISTICS;
 
-  Status = mSmmCommunication->Communicate (mSmmCommunication, SmmCommunicateHeader, SmmCommunicateSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2,
+                                           SmmCommunicateHeader,
+                                           SmmCommunicateHeader,
+                                           SmmCommunicateSize);
   ASSERT_EFI_ERROR (Status);
 
   Status = SmmVariableFunctionHeader->ReturnStatus;
@@ -76,7 +79,7 @@ PrintInfoFromSmm (
 {
   EFI_STATUS                                     Status;
   VARIABLE_INFO_ENTRY                            *VariableInfo;
-  EFI_SMM_COMMUNICATE_HEADER                     *CommBuffer;
+  EFI_MM_COMMUNICATE_HEADER                      *CommBuffer;
   UINTN                                          RealCommSize;
   UINTN                                          CommSize;
   SMM_VARIABLE_COMMUNICATE_HEADER                *FunctionHeader;
@@ -92,7 +95,7 @@ PrintInfoFromSmm (
     return Status;
   }
 
-  Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);
+  Status = gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid, NULL, (VOID **) &mMmCommunication2);
   if (EFI_ERROR (Status)) {
     return Status;
   }
@@ -117,7 +120,7 @@ PrintInfoFromSmm (
         if (Size > MaxSize) {
           MaxSize = Size;
           RealCommSize = MaxSize;
-          CommBuffer = (EFI_SMM_COMMUNICATE_HEADER *) (UINTN) Entry->PhysicalStart;
+          CommBuffer = (EFI_MM_COMMUNICATE_HEADER *) (UINTN) Entry->PhysicalStart;
         }
       }
     }
diff --git a/MdeModulePkg/Application/VariableInfo/VariableInfo.inf b/MdeModulePkg/Application/VariableInfo/VariableInfo.inf
index 0706ea2ead59..f7c533b54641 100644
--- a/MdeModulePkg/Application/VariableInfo/VariableInfo.inf
+++ b/MdeModulePkg/Application/VariableInfo/VariableInfo.inf
@@ -41,7 +41,7 @@ [LibraryClasses]
   MemoryAllocationLib
 
 [Protocols]
-  gEfiSmmCommunicationProtocolGuid   ## SOMETIMES_CONSUMES
+  gEfiMmCommunication2ProtocolGuid   ## SOMETIMES_CONSUMES
 
   ## UNDEFINED            # Used to do smm communication
   ## SOMETIMES_CONSUMES
-- 
2.17.1


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

* [PATCH 5/7] MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
                   ` (3 preceding siblings ...)
  2019-12-06 15:29 ` [PATCH 4/7] MdeModulePkg/VariableInfo: switch to MM communicate " Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 6/7] MdeModulePkg/VariableSmmRuntimeDxe: " Ard Biesheuvel
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Switch to the new MM communicate 2 protocol which supports both
traditional and standalone MM.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h |  2 +-
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c    | 25 +++++++++++---------
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.h    |  2 +-
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf  |  4 ++--
 4 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
index 4546a1b445b9..5f0eec0506ed 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h
@@ -29,7 +29,7 @@ typedef struct {
 ///
 /// Size of SMM communicate header, without including the payload.
 ///
-#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))
+#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data))
 
 ///
 /// Size of SMM FTW communicate function header, without including the payload.
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c
index 6e3eb3b58b09..24c20950296d 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.c
@@ -11,7 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "FaultTolerantWriteSmmDxe.h"
 
 EFI_HANDLE                         mHandle                   = NULL;
-EFI_SMM_COMMUNICATION_PROTOCOL     *mSmmCommunication        = NULL;
+EFI_MM_COMMUNICATION2_PROTOCOL     *mMmCommunication2        = NULL;
 UINTN                              mPrivateDataSize          = 0;
 
 EFI_FAULT_TOLERANT_WRITE_PROTOCOL  mFaultTolerantWriteDriver = {
@@ -40,7 +40,7 @@ InitCommunicateBuffer (
   IN      UINTN                             Function
   )
 {
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_COMMUNICATE_FUNCTION_HEADER       *SmmFtwFunctionHeader;
 
   //
@@ -74,7 +74,7 @@ InitCommunicateBuffer (
 **/
 EFI_STATUS
 SendCommunicateBuffer (
-  IN OUT  EFI_SMM_COMMUNICATE_HEADER        *SmmCommunicateHeader,
+  IN OUT  EFI_MM_COMMUNICATE_HEADER         *SmmCommunicateHeader,
   IN      UINTN                             DataSize
   )
 {
@@ -83,7 +83,10 @@ SendCommunicateBuffer (
   SMM_FTW_COMMUNICATE_FUNCTION_HEADER       *SmmFtwFunctionHeader;
 
   CommSize = DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_FTW_COMMUNICATE_HEADER_SIZE;
-  Status = mSmmCommunication->Communicate (mSmmCommunication, SmmCommunicateHeader, &CommSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2,
+                                           SmmCommunicateHeader,
+                                           SmmCommunicateHeader,
+                                           &CommSize);
   ASSERT_EFI_ERROR (Status);
 
   SmmFtwFunctionHeader = (SMM_FTW_COMMUNICATE_FUNCTION_HEADER *) SmmCommunicateHeader->Data;
@@ -148,7 +151,7 @@ FtwGetMaxBlockSize (
 {
   EFI_STATUS                                Status;
   UINTN                                     PayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_GET_MAX_BLOCK_SIZE_HEADER         *SmmFtwBlockSizeHeader;
 
   //
@@ -204,7 +207,7 @@ FtwAllocate (
 {
   EFI_STATUS                                Status;
   UINTN                                     PayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_ALLOCATE_HEADER                   *SmmFtwAllocateHeader;
 
   //
@@ -270,7 +273,7 @@ FtwWrite (
 {
   EFI_STATUS                                Status;
   UINTN                                     PayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_WRITE_HEADER                      *SmmFtwWriteHeader;
 
   //
@@ -336,7 +339,7 @@ FtwRestart (
 {
   EFI_STATUS                                Status;
   UINTN                                     PayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_RESTART_HEADER                    *SmmFtwRestartHeader;
 
   //
@@ -381,7 +384,7 @@ FtwAbort (
   )
 {
   EFI_STATUS                                Status;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
 
   //
   // Initialize the communicate buffer.
@@ -438,7 +441,7 @@ FtwGetLastWrite (
 {
   EFI_STATUS                                Status;
   UINTN                                     PayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_FTW_GET_LAST_WRITE_HEADER             *SmmFtwGetLastWriteHeader;
 
   //
@@ -501,7 +504,7 @@ SmmFtwReady (
     return;
   }
 
-  Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);
+  Status = gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid, NULL, (VOID **) &mMmCommunication2);
   ASSERT_EFI_ERROR (Status);
 
   //
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.h
index 22df9103d21a..a15644abd731 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.h
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.h
@@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include <PiDxe.h>
 
-#include <Protocol/SmmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 
 #include <Library/UefiBootServicesTableLib.h>
 #include <Library/UefiDriverEntryPoint.h>
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf
index f5dc4bb4fee3..f0dd829653f1 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmDxe.inf
@@ -45,7 +45,7 @@ [LibraryClasses]
 
 [Protocols]
   gEfiFaultTolerantWriteProtocolGuid            ## PRODUCES
-  gEfiSmmCommunicationProtocolGuid              ## CONSUMES
+  gEfiMmCommunication2ProtocolGuid              ## CONSUMES
   ## NOTIFY
   ## UNDEFINED # Used to do smm communication
   ## CONSUMES
@@ -53,7 +53,7 @@ [Protocols]
   gEfiFirmwareVolumeBlockProtocolGuid           ## CONSUMES
 
 [Depex]
-  gEfiSmmCommunicationProtocolGuid
+  gEfiMmCommunication2ProtocolGuid
 
 [UserExtensions.TianoCore."ExtraFiles"]
   FaultTolerantWriteSmmDxeExtra.uni
-- 
2.17.1


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

* [PATCH 6/7] MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
                   ` (4 preceding siblings ...)
  2019-12-06 15:29 ` [PATCH 5/7] MdeModulePkg/FaultTolerantWriteSmmDxe: " Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2019-12-06 15:29 ` [PATCH 7/7] StandaloneMmPkg: " Ard Biesheuvel
  2020-01-03 13:03 ` [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Switch to the new MM communicate 2 protocol which supports both
traditional and standalone MM.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 MdeModulePkg/Include/Guid/SmmVariableCommon.h                        |  6 +--
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c   | 39 +++++++++++---------
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf |  4 +-
 3 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/SmmVariableCommon.h b/MdeModulePkg/Include/Guid/SmmVariableCommon.h
index ceef44dfd2d7..8ddc94b92da6 100644
--- a/MdeModulePkg/Include/Guid/SmmVariableCommon.h
+++ b/MdeModulePkg/Include/Guid/SmmVariableCommon.h
@@ -20,7 +20,7 @@ extern EFI_GUID gSmmVariableWriteGuid;
 //
 // This structure is used for SMM variable. the collected statistics data is saved in SMRAM. It can be got from
 // SMI handler. The communication buffer should be:
-// EFI_SMM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.
+// EFI_MM_COMMUNICATE_HEADER + SMM_VARIABLE_COMMUNICATE_HEADER + payload.
 //
 typedef struct {
   UINTN       Function;
@@ -53,7 +53,7 @@ typedef struct {
 //
 #define SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE       6
 //
-// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_SMM_COMMUNICATE_HEADER
+// The payload for this function is VARIABLE_INFO_ENTRY. The GUID in EFI_MM_COMMUNICATE_HEADER
 // is gEfiSmmVariableProtocolGuid.
 //
 #define SMM_VARIABLE_FUNCTION_GET_STATISTICS          7
@@ -81,7 +81,7 @@ typedef struct {
 ///
 /// Size of SMM communicate header, without including the payload.
 ///
-#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data))
+#define SMM_COMMUNICATE_HEADER_SIZE  (OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data))
 
 ///
 /// Size of SMM variable communicate header, without including the payload.
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
index 2cf0ed32ae55..c6777ec46d17 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -20,7 +20,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <PiDxe.h>
 #include <Protocol/VariableWrite.h>
 #include <Protocol/Variable.h>
-#include <Protocol/SmmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 #include <Protocol/SmmVariable.h>
 #include <Protocol/VariableLock.h>
 #include <Protocol/VarCheck.h>
@@ -44,7 +44,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 EFI_HANDLE                       mHandle                    = NULL;
 EFI_SMM_VARIABLE_PROTOCOL       *mSmmVariable               = NULL;
 EFI_EVENT                        mVirtualAddressChangeEvent = NULL;
-EFI_SMM_COMMUNICATION_PROTOCOL  *mSmmCommunication          = NULL;
+EFI_MM_COMMUNICATION2_PROTOCOL  *mMmCommunication2          = NULL;
 UINT8                           *mVariableBuffer            = NULL;
 UINT8                           *mVariableBufferPhysical    = NULL;
 VARIABLE_INFO_ENTRY             *mVariableInfo              = NULL;
@@ -209,7 +209,7 @@ InitCommunicateBuffer (
   IN      UINTN                             Function
   )
 {
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_VARIABLE_COMMUNICATE_HEADER           *SmmVariableFunctionHeader;
 
 
@@ -217,7 +217,7 @@ InitCommunicateBuffer (
     return EFI_INVALID_PARAMETER;
   }
 
-  SmmCommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *) mVariableBuffer;
+  SmmCommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *) mVariableBuffer;
   CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
   SmmCommunicateHeader->MessageLength = DataSize + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE;
 
@@ -247,14 +247,17 @@ SendCommunicateBuffer (
 {
   EFI_STATUS                                Status;
   UINTN                                     CommSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_VARIABLE_COMMUNICATE_HEADER           *SmmVariableFunctionHeader;
 
   CommSize = DataSize + SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE;
-  Status = mSmmCommunication->Communicate (mSmmCommunication, mVariableBufferPhysical, &CommSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2,
+                                           mVariableBufferPhysical,
+                                           mVariableBuffer,
+                                           &CommSize);
   ASSERT_EFI_ERROR (Status);
 
-  SmmCommunicateHeader      = (EFI_SMM_COMMUNICATE_HEADER *) mVariableBuffer;
+  SmmCommunicateHeader      = (EFI_MM_COMMUNICATE_HEADER *) mVariableBuffer;
   SmmVariableFunctionHeader = (SMM_VARIABLE_COMMUNICATE_HEADER *)SmmCommunicateHeader->Data;
   return  SmmVariableFunctionHeader->ReturnStatus;
 }
@@ -1307,7 +1310,7 @@ VariableAddressChangeEvent (
   )
 {
   EfiConvertPointer (0x0, (VOID **) &mVariableBuffer);
-  EfiConvertPointer (0x0, (VOID **) &mSmmCommunication);
+  EfiConvertPointer (0x0, (VOID **) &mMmCommunication2);
   EfiConvertPointer (EFI_OPTIONAL_PTR, (VOID **) &mVariableRuntimeHobCacheBuffer);
   EfiConvertPointer (EFI_OPTIONAL_PTR, (VOID **) &mVariableRuntimeNvCacheBuffer);
   EfiConvertPointer (EFI_OPTIONAL_PTR, (VOID **) &mVariableRuntimeVolatileCacheBuffer);
@@ -1330,7 +1333,7 @@ GetVariablePayloadSize (
 {
   EFI_STATUS                                Status;
   SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE *SmmGetPayloadSize;
-  EFI_SMM_COMMUNICATE_HEADER                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                 *SmmCommunicateHeader;
   SMM_VARIABLE_COMMUNICATE_HEADER           *SmmVariableFunctionHeader;
   UINTN                                     CommSize;
   UINT8                                     *CommBuffer;
@@ -1355,7 +1358,7 @@ GetVariablePayloadSize (
     goto Done;
   }
 
-  SmmCommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *) CommBuffer;
+  SmmCommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *) CommBuffer;
   CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
   SmmCommunicateHeader->MessageLength = SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_GET_PAYLOAD_SIZE);
 
@@ -1366,7 +1369,7 @@ GetVariablePayloadSize (
   //
   // Send data to SMM.
   //
-  Status = mSmmCommunication->Communicate (mSmmCommunication, CommBuffer, &CommSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
   ASSERT_EFI_ERROR (Status);
 
   Status = SmmVariableFunctionHeader->ReturnStatus;
@@ -1411,7 +1414,7 @@ GetRuntimeCacheInfo (
 {
   EFI_STATUS                                          Status;
   SMM_VARIABLE_COMMUNICATE_GET_RUNTIME_CACHE_INFO     *SmmGetRuntimeCacheInfo;
-  EFI_SMM_COMMUNICATE_HEADER                          *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                           *SmmCommunicateHeader;
   SMM_VARIABLE_COMMUNICATE_HEADER                     *SmmVariableFunctionHeader;
   UINTN                                               CommSize;
   UINT8                                               *CommBuffer;
@@ -1432,7 +1435,7 @@ GetRuntimeCacheInfo (
   CommSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_GET_RUNTIME_CACHE_INFO);
   ZeroMem (CommBuffer, CommSize);
 
-  SmmCommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *) CommBuffer;
+  SmmCommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *) CommBuffer;
   CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
   SmmCommunicateHeader->MessageLength = SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_GET_RUNTIME_CACHE_INFO);
 
@@ -1443,7 +1446,7 @@ GetRuntimeCacheInfo (
   //
   // Send data to SMM.
   //
-  Status = mSmmCommunication->Communicate (mSmmCommunication, CommBuffer, &CommSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
   ASSERT_EFI_ERROR (Status);
   if (CommSize <= SMM_VARIABLE_COMMUNICATE_HEADER_SIZE) {
     Status = EFI_BAD_BUFFER_SIZE;
@@ -1484,7 +1487,7 @@ SendRuntimeVariableCacheContextToSmm (
 {
   EFI_STATUS                                                Status;
   SMM_VARIABLE_COMMUNICATE_RUNTIME_VARIABLE_CACHE_CONTEXT   *SmmRuntimeVarCacheContext;
-  EFI_SMM_COMMUNICATE_HEADER                                *SmmCommunicateHeader;
+  EFI_MM_COMMUNICATE_HEADER                                 *SmmCommunicateHeader;
   SMM_VARIABLE_COMMUNICATE_HEADER                           *SmmVariableFunctionHeader;
   UINTN                                                     CommSize;
   UINT8                                                     *CommBuffer;
@@ -1505,7 +1508,7 @@ SendRuntimeVariableCacheContextToSmm (
   CommSize = SMM_COMMUNICATE_HEADER_SIZE + SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_RUNTIME_VARIABLE_CACHE_CONTEXT);
   ZeroMem (CommBuffer, CommSize);
 
-  SmmCommunicateHeader = (EFI_SMM_COMMUNICATE_HEADER *) CommBuffer;
+  SmmCommunicateHeader = (EFI_MM_COMMUNICATE_HEADER *) CommBuffer;
   CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
   SmmCommunicateHeader->MessageLength = SMM_VARIABLE_COMMUNICATE_HEADER_SIZE + sizeof (SMM_VARIABLE_COMMUNICATE_RUNTIME_VARIABLE_CACHE_CONTEXT);
 
@@ -1523,7 +1526,7 @@ SendRuntimeVariableCacheContextToSmm (
   //
   // Send data to SMM.
   //
-  Status = mSmmCommunication->Communicate (mSmmCommunication, CommBuffer, &CommSize);
+  Status = mMmCommunication2->Communicate (mMmCommunication2, CommBuffer, CommBuffer, &CommSize);
   ASSERT_EFI_ERROR (Status);
   if (CommSize <= SMM_VARIABLE_COMMUNICATE_HEADER_SIZE) {
     Status = EFI_BAD_BUFFER_SIZE;
@@ -1561,7 +1564,7 @@ SmmVariableReady (
     return;
   }
 
-  Status = gBS->LocateProtocol (&gEfiSmmCommunicationProtocolGuid, NULL, (VOID **) &mSmmCommunication);
+  Status = gBS->LocateProtocol (&gEfiMmCommunication2ProtocolGuid, NULL, (VOID **) &mMmCommunication2);
   ASSERT_EFI_ERROR (Status);
 
   //
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
index 592862773390..01564e4c5068 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
@@ -60,7 +60,7 @@ [LibraryClasses]
 [Protocols]
   gEfiVariableWriteArchProtocolGuid             ## PRODUCES
   gEfiVariableArchProtocolGuid                  ## PRODUCES
-  gEfiSmmCommunicationProtocolGuid              ## CONSUMES
+  gEfiMmCommunication2ProtocolGuid              ## CONSUMES
   ## CONSUMES
   ## NOTIFY
   ## UNDEFINED # Used to do smm communication
@@ -100,7 +100,7 @@ [Guids]
   gEfiImageSecurityDatabaseGuid
 
 [Depex]
-  gEfiSmmCommunicationProtocolGuid
+  gEfiMmCommunication2ProtocolGuid
 
 [UserExtensions.TianoCore."ExtraFiles"]
   VariableSmmRuntimeDxeExtra.uni
-- 
2.17.1


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

* [PATCH 7/7] StandaloneMmPkg: switch to MM communicate 2 protocol
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
                   ` (5 preceding siblings ...)
  2019-12-06 15:29 ` [PATCH 6/7] MdeModulePkg/VariableSmmRuntimeDxe: " Ard Biesheuvel
@ 2019-12-06 15:29 ` Ard Biesheuvel
  2020-01-03 13:03 ` [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
  7 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 15:29 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Update the reference to MM communicate to refer to the MM communicate 2
protocol instead. This makes no difference for the MM side of the
implementation, but is more accurate nonetheless, since the original MM
protocol does not work in combination with standalone MM.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 StandaloneMmPkg/Core/StandaloneMmCore.h                           | 2 +-
 StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h
index 86f6cfa55a35..96c195311add 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.h
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.h
@@ -18,7 +18,7 @@
 #include <Protocol/DxeMmReadyToLock.h>
 #include <Protocol/MmReadyToLock.h>
 #include <Protocol/MmEndOfDxe.h>
-#include <Protocol/MmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 #include <Protocol/LoadedImage.h>
 #include <Protocol/MmConfiguration.h>
 
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h
index 71be5cf17272..47a020c27b95 100644
--- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h
@@ -10,7 +10,7 @@
 #ifndef _ARM_TF_CPU_DRIVER_H_
 #define _ARM_TF_CPU_DRIVER_H_
 
-#include <Protocol/MmCommunication.h>
+#include <Protocol/MmCommunication2.h>
 #include <Protocol/MmConfiguration.h>
 #include <Protocol/MmCpu.h>
 #include <Guid/MpInformation.h>
-- 
2.17.1


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

* Re: [PATCH 2/7] MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
  2019-12-06 15:29 ` [PATCH 2/7] MdeModulePkg/SmmIpl: expose " Ard Biesheuvel
@ 2019-12-06 16:01   ` Ard Biesheuvel
  0 siblings, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2019-12-06 16:01 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: edk2-devel-groups-io, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

On Fri, 6 Dec 2019 at 15:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
>
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> The MM communicate 2 protocol was introduced to factor out the mismatch
> between traditional MM, which requires the physical address of the MM
> buffer to be passed, and standalone MM, which copies the MM communicate
> buffer data into a separate buffer, requiring the virtual address. For
> this reason, MM communicate 2 carries both addresses, allowing the
> implementation to decide which address it needs.
>
> This hides this implementation detail from the callers of the protocol,
> which simply passes both addresses without having to reason about what the
> implementation of the protocol actually needs.
>
> Note that the old version of the protocol is retained, in order to support
> existing implementations that don't require this flexibility.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c   | 79 ++++++++++++++++++++
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf |  1 +
>  2 files changed, 80 insertions(+)
>

The following hunk needs to be added to this patch, but it got lost
somehow. Apologies.


--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -1837,6 +1837,7 @@ SmmIplEntry (
                   &mSmmIplHandle,
                   &gEfiSmmBase2ProtocolGuid,         &mSmmBase2,
                   &gEfiSmmCommunicationProtocolGuid, &mSmmCommunication,
+                  &gEfiMmCommunication2ProtocolGuid, &mMmCommunication2,
                   NULL
                   );
   ASSERT_EFI_ERROR (Status);




> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
> index 1cf8c93227a3..d86b8b4a6a29 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
> @@ -10,6 +10,7 @@
>
>  #include <Protocol/SmmBase2.h>
>  #include <Protocol/SmmCommunication.h>
> +#include <Protocol/MmCommunication2.h>
>  #include <Protocol/SmmAccess2.h>
>  #include <Protocol/SmmConfiguration.h>
>  #include <Protocol/SmmControl2.h>
> @@ -118,6 +119,39 @@ SmmCommunicationCommunicate (
>    IN OUT UINTN                             *CommSize OPTIONAL
>    );
>
> +/**
> +  Communicates with a registered handler.
> +
> +  This function provides a service to send and receive messages from a registered UEFI service.
> +
> +  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
> +  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
> +  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
> +  @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.
> +                                 This parameter is optional and may be NULL.
> +
> +  @retval EFI_SUCCESS            The message was successfully posted.
> +  @retval EFI_INVALID_PARAMETER  The CommBuffer was NULL.
> +  @retval 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.
> +  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
> +                                 if not omitted, are in address range that cannot be
> +                                 accessed by the MM environment.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +SmmCommunicationMmCommunicate2 (
> +  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
> +  IN OUT VOID                               *CommBufferPhysical,
> +  IN OUT VOID                               *CommBufferVirtual,
> +  IN OUT UINTN                              *CommSize OPTIONAL
> +  );
> +
>  /**
>    Event notification that is fired every time a gEfiSmmConfigurationProtocol installs.
>
> @@ -240,6 +274,13 @@ EFI_SMM_COMMUNICATION_PROTOCOL  mSmmCommunication = {
>    SmmCommunicationCommunicate
>  };
>
> +//
> +// PI 1.7 MM Communication Protocol 2 instance
> +//
> +EFI_MM_COMMUNICATION2_PROTOCOL  mMmCommunication2 = {
> +  SmmCommunicationMmCommunicate2
> +};
> +
>  //
>  // SMM Core Private Data structure that contains the data shared between
>  // the SMM IPL and the SMM Core.
> @@ -576,6 +617,44 @@ SmmCommunicationCommunicate (
>    return (Status == EFI_SUCCESS) ? EFI_SUCCESS : EFI_NOT_FOUND;
>  }
>
> +/**
> +  Communicates with a registered handler.
> +
> +  This function provides a service to send and receive messages from a registered UEFI service.
> +
> +  @param[in] This                The EFI_MM_COMMUNICATION_PROTOCOL instance.
> +  @param[in] CommBufferPhysical  Physical address of the MM communication buffer
> +  @param[in] CommBufferVirtual   Virtual address of the MM communication buffer
> +  @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.
> +                                 This parameter is optional and may be NULL.
> +
> +  @retval EFI_SUCCESS            The message was successfully posted.
> +  @retval EFI_INVALID_PARAMETER  The CommBuffer was NULL.
> +  @retval 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.
> +  @retval EFI_ACCESS_DENIED      The CommunicateBuffer parameter or CommSize parameter,
> +                                 if not omitted, are in address range that cannot be
> +                                 accessed by the MM environment.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +SmmCommunicationMmCommunicate2 (
> +  IN CONST EFI_MM_COMMUNICATION2_PROTOCOL   *This,
> +  IN OUT VOID                               *CommBufferPhysical,
> +  IN OUT VOID                               *CommBufferVirtual,
> +  IN OUT UINTN                              *CommSize OPTIONAL
> +  )
> +{
> +  return SmmCommunicationCommunicate (&mSmmCommunication,
> +                                      CommBufferPhysical,
> +                                      CommSize);
> +}
> +
>  /**
>    Event notification that is fired when GUIDed Event Group is signaled.
>
> diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> index b6b1bbcdac51..0a05d593522e 100644
> --- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> +++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
> @@ -50,6 +50,7 @@ [LibraryClasses]
>  [Protocols]
>    gEfiSmmBase2ProtocolGuid                      ## PRODUCES
>    gEfiSmmCommunicationProtocolGuid              ## PRODUCES
> +  gEfiMmCommunication2ProtocolGuid              ## PRODUCES
>    gEfiSmmAccess2ProtocolGuid                    ## CONSUMES
>    ## NOTIFY
>    ## CONSUMES
> --
> 2.17.1
>

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

* Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
                   ` (6 preceding siblings ...)
  2019-12-06 15:29 ` [PATCH 7/7] StandaloneMmPkg: " Ard Biesheuvel
@ 2020-01-03 13:03 ` Ard Biesheuvel
  2020-01-06  1:16   ` Liming Gao
  7 siblings, 1 reply; 15+ messages in thread
From: Ard Biesheuvel @ 2020-01-03 13:03 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: edk2-devel-groups-io, Michael D Kinney, Leif Lindholm, Liming Gao,
	Hao A Wu, Eric Dong, Ray Ni, Achin Gupta, Jiewen Yao

On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
>
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> This series implements the changes proposed by Mantis ticket 1993, which
> describes how we need to modify the MM communicate protocol to make it
> compatible with standalone MM based DXE_RUNTIME_DRIVER MM client using
> virtually remapped memory.
>
> These changes have been accepted as errata for PI spec v1.7
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Achin Gupta <achin.gupta@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
>

Ping?


> Ard Biesheuvel (7):
>   MdePkg: introduce MM communicate 2 protocol
>   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
>   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
>   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
>   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
>     protocol
>   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
>     protocol
>   StandaloneMmPkg: switch to MM communicate 2 protocol
>
>  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
>  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
>  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
>  .../Application/VariableInfo/VariableInfo.inf |  2 +-
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
>  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
>  .../FaultTolerantWriteSmmCommon.h             |  2 +-
>  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
>  .../FaultTolerantWriteSmmDxe.h                |  2 +-
>  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
>  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
>  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
>  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
>  MdePkg/MdePkg.dec                             |  7 ++
>  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
>  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
>  17 files changed, 254 insertions(+), 94 deletions(-)
>  create mode 100644 MdePkg/Include/Protocol/MmCommunication2.h
>
> --
> 2.17.1
>

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

* Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2020-01-03 13:03 ` [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
@ 2020-01-06  1:16   ` Liming Gao
  2020-03-06 10:38     ` Ard Biesheuvel
  0 siblings, 1 reply; 15+ messages in thread
From: Liming Gao @ 2020-01-06  1:16 UTC (permalink / raw)
  To: Ard Biesheuvel, Ard Biesheuvel
  Cc: edk2-devel-groups-io, Kinney, Michael D, Leif Lindholm, Wu, Hao A,
	Dong, Eric, Ni, Ray, Achin Gupta, Yao, Jiewen

Ard:
 The changes are good to me. But, I think this change will not be added into MdePkg until PI1.7 errata A is published.  

Thanks
Liming
-----Original Message-----
From: Ard Biesheuvel <ard.biesheuvel@linaro.org> 
Sent: 2020年1月3日 21:03
To: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: Re: [PATCH 0/7] New implementation of MM communicate for standalone MM

On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
>
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> This series implements the changes proposed by Mantis ticket 1993, 
> which describes how we need to modify the MM communicate protocol to 
> make it compatible with standalone MM based DXE_RUNTIME_DRIVER MM 
> client using virtually remapped memory.
>
> These changes have been accepted as errata for PI spec v1.7
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Achin Gupta <achin.gupta@arm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
>

Ping?


> Ard Biesheuvel (7):
>   MdePkg: introduce MM communicate 2 protocol
>   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
>   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
>   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
>   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
>     protocol
>   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
>     protocol
>   StandaloneMmPkg: switch to MM communicate 2 protocol
>
>  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
>  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
>  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
>  .../Application/VariableInfo/VariableInfo.inf |  2 +-
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
>  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
>  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
>  .../FaultTolerantWriteSmmCommon.h             |  2 +-
>  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
>  .../FaultTolerantWriteSmmDxe.h                |  2 +-
>  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
>  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
>  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
>  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
>  MdePkg/MdePkg.dec                             |  7 ++
>  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
>  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
>  17 files changed, 254 insertions(+), 94 deletions(-)  create mode 
> 100644 MdePkg/Include/Protocol/MmCommunication2.h
>
> --
> 2.17.1
>

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

* Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2020-01-06  1:16   ` Liming Gao
@ 2020-03-06 10:38     ` Ard Biesheuvel
  2020-03-11 18:12       ` [piwg] " Doran, Mark
  0 siblings, 1 reply; 15+ messages in thread
From: Ard Biesheuvel @ 2020-03-06 10:38 UTC (permalink / raw)
  To: Gao, Liming, Stuart Yoder, Zimmer, Vincent, piwg
  Cc: Ard Biesheuvel, edk2-devel-groups-io, Kinney, Michael D,
	Leif Lindholm, Wu, Hao A, Dong, Eric, Ni, Ray, Achin Gupta,
	Yao, Jiewen

(adding PIWG and some other folks to cc)

On Mon, 6 Jan 2020 at 02:16, Gao, Liming <liming.gao@intel.com> wrote:
>
> Ard:
>  The changes are good to me. But, I think this change will not be added into MdePkg until PI1.7 errata A is published.
>

Hello all,

Due to the Huawei situation, and now the fact that there is little
movement in the PIWG, these changes have been in limbo for over a year
now.

Is there any way we can progress with this independently? Or push on
with the publication of PI 1.7 errata A ?

Thanks,
Ard.



> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: 2020年1月3日 21:03
> To: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
>
> On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
> >
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > This series implements the changes proposed by Mantis ticket 1993,
> > which describes how we need to modify the MM communicate protocol to
> > make it compatible with standalone MM based DXE_RUNTIME_DRIVER MM
> > client using virtually remapped memory.
> >
> > These changes have been accepted as errata for PI spec v1.7
> >
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Achin Gupta <achin.gupta@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> >
>
> Ping?
>
>
> > Ard Biesheuvel (7):
> >   MdePkg: introduce MM communicate 2 protocol
> >   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
> >   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
> >   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
> >   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
> >     protocol
> >   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
> >     protocol
> >   StandaloneMmPkg: switch to MM communicate 2 protocol
> >
> >  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
> >  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
> >  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
> >  .../Application/VariableInfo/VariableInfo.inf |  2 +-
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
> >  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
> >  .../FaultTolerantWriteSmmCommon.h             |  2 +-
> >  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
> >  .../FaultTolerantWriteSmmDxe.h                |  2 +-
> >  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
> >  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
> >  MdePkg/MdePkg.dec                             |  7 ++
> >  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
> >  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
> >  17 files changed, 254 insertions(+), 94 deletions(-)  create mode
> > 100644 MdePkg/Include/Protocol/MmCommunication2.h
> >
> > --
> > 2.17.1
> >

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

* Re: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2020-03-06 10:38     ` Ard Biesheuvel
@ 2020-03-11 18:12       ` Doran, Mark
  2020-03-11 18:20         ` Ard Biesheuvel
  2020-03-11 18:24         ` Shaw, Kevin W
  0 siblings, 2 replies; 15+ messages in thread
From: Doran, Mark @ 2020-03-11 18:12 UTC (permalink / raw)
  To: Ard Biesheuvel, Gao, Liming, Stuart Yoder, Zimmer, Vincent,
	piwg@uefi.org
  Cc: Ard Biesheuvel, edk2-devel-groups-io, Kinney, Michael D,
	Leif Lindholm, Wu, Hao A, Dong, Eric, Ni, Ray, Achin Gupta,
	Yao, Jiewen

Apologies for the delay -- I just found this by accident looking at the PIWG email archive for something else which prompted me to find the note below in the spam trap for some reason.  Anyhow...

UEFI spec publications and errata are kind of demand-driven - we don't keep a regular schedule so much as make one for an errata or new spec version when a contributor requests that they want one to meet a product deliverable or some equivalent external event that needs to read on an update.  Lazy evaluation if you will.

Which is to say right now there isn't a PI 1.7A schedule but we can make one 😊  

To be sure we have this right is there one specific PI ECR we're talking about or more than one for this??  If we can identify which peg we need put into an errata version to hang these code changes from then I can get with Vincent and we can have the work group crank this handle.

That said...

The one caveat that applies right this second is that the conversion of the spec sources is in flight.  Our tech writer may tell me that there are some related limitations on when exactly we can practically make an update.  I don't want to pollute the open lists copied here with that UEFI Forum internal housekeeping but I did want to mention that as a factor by way of not wanting to over-promise an instant fix.

--
Cheers,

Mark.

-----Original Message-----
From: piwg@uefi.org <piwg@uefi.org> On Behalf Of Ard Biesheuvel
Sent: Friday, March 6, 2020 2:38 AM
To: Gao, Liming <liming.gao@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>; Zimmer, Vincent <vincent.zimmer@intel.com>; piwg@uefi.org
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM

(adding PIWG and some other folks to cc)

On Mon, 6 Jan 2020 at 02:16, Gao, Liming <liming.gao@intel.com> wrote:
>
> Ard:
>  The changes are good to me. But, I think this change will not be added into MdePkg until PI1.7 errata A is published.
>

Hello all,

Due to the Huawei situation, and now the fact that there is little movement in the PIWG, these changes have been in limbo for over a year now.

Is there any way we can progress with this independently? Or push on with the publication of PI 1.7 errata A ?

Thanks,
Ard.



> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: 2020年1月3日 21:03
> To: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Leif Lindholm 
> <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Wu, 
> Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray 
> <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen 
> <jiewen.yao@intel.com>
> Subject: Re: [PATCH 0/7] New implementation of MM communicate for 
> standalone MM
>
> On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
> >
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > This series implements the changes proposed by Mantis ticket 1993, 
> > which describes how we need to modify the MM communicate protocol to 
> > make it compatible with standalone MM based DXE_RUNTIME_DRIVER MM 
> > client using virtually remapped memory.
> >
> > These changes have been accepted as errata for PI spec v1.7
> >
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Achin Gupta <achin.gupta@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> >
>
> Ping?
>
>
> > Ard Biesheuvel (7):
> >   MdePkg: introduce MM communicate 2 protocol
> >   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
> >   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
> >   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
> >   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
> >     protocol
> >   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
> >     protocol
> >   StandaloneMmPkg: switch to MM communicate 2 protocol
> >
> >  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
> >  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
> >  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
> >  .../Application/VariableInfo/VariableInfo.inf |  2 +-
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
> >  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
> >  .../FaultTolerantWriteSmmCommon.h             |  2 +-
> >  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
> >  .../FaultTolerantWriteSmmDxe.h                |  2 +-
> >  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
> >  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
> >  MdePkg/MdePkg.dec                             |  7 ++
> >  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
> >  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
> >  17 files changed, 254 insertions(+), 94 deletions(-)  create mode
> > 100644 MdePkg/Include/Protocol/MmCommunication2.h
> >
> > --
> > 2.17.1
> >

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

* Re: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2020-03-11 18:12       ` [piwg] " Doran, Mark
@ 2020-03-11 18:20         ` Ard Biesheuvel
  2020-03-11 18:24         ` Shaw, Kevin W
  1 sibling, 0 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2020-03-11 18:20 UTC (permalink / raw)
  To: Doran, Mark
  Cc: Gao, Liming, Stuart Yoder, Zimmer, Vincent, piwg@uefi.org,
	Ard Biesheuvel, edk2-devel-groups-io, Kinney, Michael D,
	Leif Lindholm, Wu, Hao A, Dong, Eric, Ni, Ray, Achin Gupta,
	Yao, Jiewen

[-- Attachment #1: Type: text/plain, Size: 6503 bytes --]

thanks Mark

this is about mantis ticket 1993, which is a prerequisite for building
anything based on standalone mm that involves a va switch at runtime

i don't care deeply about the pace at which things move, as long as they
move at all, so I'm happy to settle for whatever is workable for the
editorial team


On Wed, Mar 11, 2020, 14:12 Doran, Mark <mark.doran@intel.com> wrote:

> Apologies for the delay -- I just found this by accident looking at the
> PIWG email archive for something else which prompted me to find the note
> below in the spam trap for some reason.  Anyhow...
>
> UEFI spec publications and errata are kind of demand-driven - we don't
> keep a regular schedule so much as make one for an errata or new spec
> version when a contributor requests that they want one to meet a product
> deliverable or some equivalent external event that needs to read on an
> update.  Lazy evaluation if you will.
>
> Which is to say right now there isn't a PI 1.7A schedule but we can make
> one 😊
>
> To be sure we have this right is there one specific PI ECR we're talking
> about or more than one for this??  If we can identify which peg we need put
> into an errata version to hang these code changes from then I can get with
> Vincent and we can have the work group crank this handle.
>
> That said...
>
> The one caveat that applies right this second is that the conversion of
> the spec sources is in flight.  Our tech writer may tell me that there are
> some related limitations on when exactly we can practically make an
> update.  I don't want to pollute the open lists copied here with that UEFI
> Forum internal housekeeping but I did want to mention that as a factor by
> way of not wanting to over-promise an instant fix.
>
> --
> Cheers,
>
> Mark.
>
> -----Original Message-----
> From: piwg@uefi.org <piwg@uefi.org> On Behalf Of Ard Biesheuvel
> Sent: Friday, March 6, 2020 2:38 AM
> To: Gao, Liming <liming.gao@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>;
> Zimmer, Vincent <vincent.zimmer@intel.com>; piwg@uefi.org
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; edk2-devel-groups-io <
> devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>;
> Leif Lindholm <leif.lindholm@linaro.org>; Wu, Hao A <hao.a.wu@intel.com>;
> Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta
> <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for
> standalone MM
>
> (adding PIWG and some other folks to cc)
>
> On Mon, 6 Jan 2020 at 02:16, Gao, Liming <liming.gao@intel.com> wrote:
> >
> > Ard:
> >  The changes are good to me. But, I think this change will not be added
> into MdePkg until PI1.7 errata A is published.
> >
>
> Hello all,
>
> Due to the Huawei situation, and now the fact that there is little
> movement in the PIWG, these changes have been in limbo for over a year now.
>
> Is there any way we can progress with this independently? Or push on with
> the publication of PI 1.7 errata A ?
>
> Thanks,
> Ard.
>
>
>
> > -----Original Message-----
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Sent: 2020年1月3日 21:03
> > To: Ard Biesheuvel <ard.biesheuvel@arm.com>
> > Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Leif Lindholm
> > <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Wu,
> > Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray
> > <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen
> > <jiewen.yao@intel.com>
> > Subject: Re: [PATCH 0/7] New implementation of MM communicate for
> > standalone MM
> >
> > On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com>
> wrote:
> > >
> > > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > >
> > > This series implements the changes proposed by Mantis ticket 1993,
> > > which describes how we need to modify the MM communicate protocol to
> > > make it compatible with standalone MM based DXE_RUNTIME_DRIVER MM
> > > client using virtually remapped memory.
> > >
> > > These changes have been accepted as errata for PI spec v1.7
> > >
> > > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > > Cc: Liming Gao <liming.gao@intel.com>
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > Cc: Eric Dong <eric.dong@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Cc: Achin Gupta <achin.gupta@arm.com>
> > > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > >
> >
> > Ping?
> >
> >
> > > Ard Biesheuvel (7):
> > >   MdePkg: introduce MM communicate 2 protocol
> > >   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
> > >   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
> > >   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
> > >   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
> > >     protocol
> > >   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
> > >     protocol
> > >   StandaloneMmPkg: switch to MM communicate 2 protocol
> > >
> > >  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
> > >  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
> > >  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
> > >  .../Application/VariableInfo/VariableInfo.inf |  2 +-
> > >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
> > >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
> > >  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
> > >  .../FaultTolerantWriteSmmCommon.h             |  2 +-
> > >  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
> > >  .../FaultTolerantWriteSmmDxe.h                |  2 +-
> > >  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
> > >  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
> > >  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
> > >  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
> > >  MdePkg/MdePkg.dec                             |  7 ++
> > >  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
> > >  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
> > >  17 files changed, 254 insertions(+), 94 deletions(-)  create mode
> > > 100644 MdePkg/Include/Protocol/MmCommunication2.h
> > >
> > > --
> > > 2.17.1
> > >
>

[-- Attachment #2: Type: text/html, Size: 10574 bytes --]

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

* Re: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM
  2020-03-11 18:12       ` [piwg] " Doran, Mark
  2020-03-11 18:20         ` Ard Biesheuvel
@ 2020-03-11 18:24         ` Shaw, Kevin W
  1 sibling, 0 replies; 15+ messages in thread
From: Shaw, Kevin W @ 2020-03-11 18:24 UTC (permalink / raw)
  To: Doran, Mark, Ard Biesheuvel, Gao, Liming, Stuart Yoder,
	Zimmer, Vincent, piwg@uefi.org
  Cc: Ard Biesheuvel, edk2-devel-groups-io, Kinney, Michael D,
	Leif Lindholm, Wu, Hao A, Dong, Eric, Ni, Ray, Achin Gupta,
	Yao, Jiewen

I haven't started the conversion work for the PI spec, so we can do an errata update promptly if we decide on that soon (say by end of March).  

- Kevin

-----Original Message-----
From: piwg@uefi.org <piwg@uefi.org> On Behalf Of Doran, Mark
Sent: Wednesday, March 11, 2020 11:12 AM
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Gao, Liming <liming.gao@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>; Zimmer, Vincent <vincent.zimmer@intel.com>; piwg@uefi.org
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: RE: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM

Apologies for the delay -- I just found this by accident looking at the PIWG email archive for something else which prompted me to find the note below in the spam trap for some reason.  Anyhow...

UEFI spec publications and errata are kind of demand-driven - we don't keep a regular schedule so much as make one for an errata or new spec version when a contributor requests that they want one to meet a product deliverable or some equivalent external event that needs to read on an update.  Lazy evaluation if you will.

Which is to say right now there isn't a PI 1.7A schedule but we can make one 😊  

To be sure we have this right is there one specific PI ECR we're talking about or more than one for this??  If we can identify which peg we need put into an errata version to hang these code changes from then I can get with Vincent and we can have the work group crank this handle.

That said...

The one caveat that applies right this second is that the conversion of the spec sources is in flight.  Our tech writer may tell me that there are some related limitations on when exactly we can practically make an update.  I don't want to pollute the open lists copied here with that UEFI Forum internal housekeeping but I did want to mention that as a factor by way of not wanting to over-promise an instant fix.

--
Cheers,

Mark.

-----Original Message-----
From: piwg@uefi.org <piwg@uefi.org> On Behalf Of Ard Biesheuvel
Sent: Friday, March 6, 2020 2:38 AM
To: Gao, Liming <liming.gao@intel.com>; Stuart Yoder <Stuart.Yoder@arm.com>; Zimmer, Vincent <vincent.zimmer@intel.com>; piwg@uefi.org
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>; edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Leif Lindholm <leif.lindholm@linaro.org>; Wu, Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>
Subject: [piwg] Re: [PATCH 0/7] New implementation of MM communicate for standalone MM

(adding PIWG and some other folks to cc)

On Mon, 6 Jan 2020 at 02:16, Gao, Liming <liming.gao@intel.com> wrote:
>
> Ard:
>  The changes are good to me. But, I think this change will not be added into MdePkg until PI1.7 errata A is published.
>

Hello all,

Due to the Huawei situation, and now the fact that there is little movement in the PIWG, these changes have been in limbo for over a year now.

Is there any way we can progress with this independently? Or push on with the publication of PI 1.7 errata A ?

Thanks,
Ard.



> -----Original Message-----
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Sent: 2020年1月3日 21:03
> To: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Leif Lindholm 
> <leif.lindholm@linaro.org>; Gao, Liming <liming.gao@intel.com>; Wu, 
> Hao A <hao.a.wu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray 
> <ray.ni@intel.com>; Achin Gupta <achin.gupta@arm.com>; Yao, Jiewen 
> <jiewen.yao@intel.com>
> Subject: Re: [PATCH 0/7] New implementation of MM communicate for 
> standalone MM
>
> On Fri, 6 Dec 2019 at 16:29, Ard Biesheuvel <ard.biesheuvel@arm.com> wrote:
> >
> > From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > This series implements the changes proposed by Mantis ticket 1993, 
> > which describes how we need to modify the MM communicate protocol to 
> > make it compatible with standalone MM based DXE_RUNTIME_DRIVER MM 
> > client using virtually remapped memory.
> >
> > These changes have been accepted as errata for PI spec v1.7
> >
> > Cc: Michael D Kinney <michael.d.kinney@intel.com>
> > Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Achin Gupta <achin.gupta@arm.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> >
>
> Ping?
>
>
> > Ard Biesheuvel (7):
> >   MdePkg: introduce MM communicate 2 protocol
> >   MdeModulePkg/SmmIpl: expose MM communicate 2 protocol
> >   ArmPkg/MmCommunicationDxe: expose MM Communicate 2 protocol
> >   MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
> >   MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate 2
> >     protocol
> >   MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2
> >     protocol
> >   StandaloneMmPkg: switch to MM communicate 2 protocol
> >
> >  .../MmCommunicationDxe/MmCommunication.c      | 79 +++++++++----------
> >  .../MmCommunicationDxe/MmCommunication.inf    |  6 +-
> >  .../Application/VariableInfo/VariableInfo.c   | 19 +++--
> >  .../Application/VariableInfo/VariableInfo.inf |  2 +-
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c        | 79 +++++++++++++++++++
> >  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf      |  1 +
> >  MdeModulePkg/Include/Guid/SmmVariableCommon.h |  6 +-
> >  .../FaultTolerantWriteSmmCommon.h             |  2 +-
> >  .../FaultTolerantWriteSmmDxe.c                | 25 +++---
> >  .../FaultTolerantWriteSmmDxe.h                |  2 +-
> >  .../FaultTolerantWriteSmmDxe.inf              |  4 +-
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.c        | 39 ++++-----
> >  .../RuntimeDxe/VariableSmmRuntimeDxe.inf      |  4 +-
> >  MdePkg/Include/Protocol/MmCommunication2.h    | 69 ++++++++++++++++
> >  MdePkg/MdePkg.dec                             |  7 ++
> >  StandaloneMmPkg/Core/StandaloneMmCore.h       |  2 +-
> >  .../StandaloneMmCpu/AArch64/StandaloneMmCpu.h |  2 +-
> >  17 files changed, 254 insertions(+), 94 deletions(-)  create mode
> > 100644 MdePkg/Include/Protocol/MmCommunication2.h
> >
> > --
> > 2.17.1
> >

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

end of thread, other threads:[~2020-03-11 18:24 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-06 15:29 [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 1/7] MdePkg: introduce MM communicate 2 protocol Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 2/7] MdeModulePkg/SmmIpl: expose " Ard Biesheuvel
2019-12-06 16:01   ` Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 3/7] ArmPkg/MmCommunicationDxe: expose MM Communicate " Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 4/7] MdeModulePkg/VariableInfo: switch to MM communicate " Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 5/7] MdeModulePkg/FaultTolerantWriteSmmDxe: " Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 6/7] MdeModulePkg/VariableSmmRuntimeDxe: " Ard Biesheuvel
2019-12-06 15:29 ` [PATCH 7/7] StandaloneMmPkg: " Ard Biesheuvel
2020-01-03 13:03 ` [PATCH 0/7] New implementation of MM communicate for standalone MM Ard Biesheuvel
2020-01-06  1:16   ` Liming Gao
2020-03-06 10:38     ` Ard Biesheuvel
2020-03-11 18:12       ` [piwg] " Doran, Mark
2020-03-11 18:20         ` Ard Biesheuvel
2020-03-11 18:24         ` Shaw, Kevin W

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