From: Ard Biesheuvel <ard.biesheuvel@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Michael D Kinney <michael.d.kinney@intel.com>,
Leif Lindholm <leif.lindholm@linaro.org>,
Liming Gao <liming.gao@intel.com>, Hao A Wu <hao.a.wu@intel.com>,
Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Achin Gupta <achin.gupta@arm.com>,
Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH 4/7] MdeModulePkg/VariableInfo: switch to MM communicate 2 protocol
Date: Fri, 6 Dec 2019 15:29:43 +0000 [thread overview]
Message-ID: <20191206152946.624-5-ard.biesheuvel@arm.com> (raw)
In-Reply-To: <20191206152946.624-1-ard.biesheuvel@arm.com>
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
next prev parent reply other threads:[~2019-12-06 15:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ard Biesheuvel [this message]
2019-12-06 15:29 ` [PATCH 5/7] MdeModulePkg/FaultTolerantWriteSmmDxe: switch to MM communicate " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191206152946.624-5-ard.biesheuvel@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox