From nobody Thu May 16 06:01:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106444+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106444+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1687907669; cv=none; d=zohomail.com; s=zohoarc; b=D42j/gNiIcqHDODl/o2Gyf3bkkUh0JAtk1KF14TwcnIbBZ4UmepvudpbhIg1Hp7lXblDm6rSvmUUfsaUokHNV/2Swyt6pqKos7C3vluoaFf2IFAVnZLvjVuuiEFSFwnTn0Z0yPAHIB3My2/NhDOve+lzKCR7n/zq46uriDZfXkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687907669; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=mzvs2+dCusUwJ/UcqILTZbplwxKvKU2O+XnKsEWICYM=; b=a+D16lT4WvGfDFP7IKA2dMatUW4Ot+PXmMT88BGlucFXjzyWQ4hCWB8Yisy5MrB0G80uW/aeBy117rZJ5jI4hLRjI0Sn0/XPCnlUrJwEd4roz7DjUsJ7JSYhpjPfqMsN4nY+eEf2VfqpJoVbWRCovL4iMYc6AxcOttcLujKfy0o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106444+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16879076692309.882274997902186; Tue, 27 Jun 2023 16:14:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id M2sFYY1788612xORZaUyL0WV; Tue, 27 Jun 2023 16:14:28 -0700 X-Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mx.groups.io with SMTP id smtpd.web10.3899.1687907668154770173 for ; Tue, 27 Jun 2023 16:14:28 -0700 X-Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1b80b514fb7so16460595ad.0 for ; Tue, 27 Jun 2023 16:14:28 -0700 (PDT) X-Gm-Message-State: ASGyzayIxc6ZS4HCrvQxw3B0x1787277AA= X-Google-Smtp-Source: ACHHUZ5ah8SYGhlJ8F40LBLjguqMuZSRtc4nErs9HDJekoO7ehQCLblGCqjesT9SVN3It6iObrOUpQ== X-Received: by 2002:a17:902:ef94:b0:1b7:edcd:8dcd with SMTP id iz20-20020a170902ef9400b001b7edcd8dcdmr6283965plb.21.1687907667272; Tue, 27 Jun 2023 16:14:27 -0700 (PDT) X-Received: from MININT-0U7P5GU.redmond.corp.microsoft.com ([2001:4898:80e8:9:6107:268c:453f:a14b]) by smtp.gmail.com with ESMTPSA id bj8-20020a170902850800b001b7fa81b145sm4768947plb.265.2023.06.27.16.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 16:14:26 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Ronny Hansen , Shriram Masanamuthu Chinnathurai , Preshit Harlikar Subject: [edk2-devel] [PATCH v3 1/2] ArmPkg: MmCommunicationPei: Introduce MM communicate in PEI Date: Tue, 27 Jun 2023 16:14:19 -0700 Message-ID: <20230627231421.1956-2-kuqin12@gmail.com> In-Reply-To: <20230627231421.1956-1-kuqin12@gmail.com> References: <20230627231421.1956-1-kuqin12@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kuqin12@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687907668; bh=+gYwkRHQPL7XXI+CwCtkrTUR2VWvoHdN6clejvZ90lw=; h=Cc:Date:From:Reply-To:Subject:To; b=kbcJYBhxnxx5GwWmtmpgpHq7CGMBSUFcS2nRvyyACbT0QhGFhERqil0HJ8XTdsi/ykv CukR3YLMTLlMtNoF0sKbGDitCfz8kAsDxHE/Z6Sravt3N6pkHH6ZnVOmgE057Taxnf0Cd rzPI7JMhLy1g0Tufv6pOWGngT5+MW3m/eX4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687907670820100005 Content-Type: text/plain; charset="utf-8" From: Kun Qin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4464 This change introduced the MM communicate support in PEI phase for ARM based platforms. Similar to the DXE counterpart, `PcdMmBufferBase` is used as communicate buffer and SMC will be invoked to communicate to TrustZone when MMI is requested. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Co-authored-by: Ronny Hansen Co-authored-by: Shriram Masanamuthu Chinnathurai Co-authored-by: Preshit Harlikar Signed-off-by: Kun Qin --- Notes: v2: - Adjustment to CommSize checks [Sami] - Added more debug prints for error returns. =20 v3: - Removed internal header file [Ard] - Added "STATIC" and "CONST" [Ard] ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.c | 221 +++++++++++= +++++++++ ArmPkg/ArmPkg.dsc | 2 + ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf | 40 ++++ 3 files changed, 263 insertions(+) diff --git a/ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.c b/ArmPk= g/Drivers/MmCommunicationPei/MmCommunicationPei.c new file mode 100644 index 000000000000..5dbe99fc3134 --- /dev/null +++ b/ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.c @@ -0,0 +1,221 @@ +/** @file -- MmCommunicationPei.c + Provides an interface to send MM request in PEI + + Copyright (c) 2016-2021, Arm Limited. All rights reserved.
+ Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/** + MmCommunicationPeim + Communicates with a registered handler. + This function provides a service to send and receive messages from a reg= istered UEFI service during PEI. + + @param[in] This The EFI_PEI_MM_COMMUNICATION_PPI instanc= e. + @param[in, out] CommBuffer Pointer to the data buffer + @param[in, out] CommSize The size of the data buffer being passed= in. On exit, the + size of data being returned. Zero if the= handler does not + wish to reply with any data. + + @retval EFI_SUCCESS The message was successfully posted. + @retval EFI_INVALID_PARAMETER CommBuffer or CommSize was NULL, or *Com= mSize does not + match MessageLength + sizeof (EFI_MM_COM= MUNICATE_HEADER). + @retval EFI_BAD_BUFFER_SIZE The buffer is too large for the MM imple= mentation. + If this error is returned, the MessageLe= ngth field + in the CommBuffer header or the integer = pointed by + CommSize, are updated to reflect the max= imum payload + size the implementation can accommodate. + @retval EFI_ACCESS_DENIED The CommunicateBuffer parameter or CommS= ize parameter, + if not omitted, are in address range tha= t cannot be + accessed by the MM environment. +**/ +STATIC +EFI_STATUS +EFIAPI +MmCommunicationPeim ( + IN CONST EFI_PEI_MM_COMMUNICATION_PPI *This, + IN OUT VOID *CommBuffer, + IN OUT UINTN *CommSize + ) +{ + EFI_MM_COMMUNICATE_HEADER *CommunicateHeader; + EFI_MM_COMMUNICATE_HEADER *TempCommHeader; + ARM_SMC_ARGS CommunicateSmcArgs; + EFI_STATUS Status; + UINTN BufferSize; + + ZeroMem (&CommunicateSmcArgs, sizeof (ARM_SMC_ARGS)); + + // Check that our static buffer is looking good. + // We are using PcdMmBufferBase to transfer variable data. + // We are not using the full size of the buffer since there is a cost + // of copying data between Normal and Secure World. + if ((PcdGet64 (PcdMmBufferBase) =3D=3D 0) || (PcdGet64 (PcdMmBufferSize)= =3D=3D 0)) { + ASSERT (PcdGet64 (PcdMmBufferSize) > 0); + ASSERT (PcdGet64 (PcdMmBufferBase) !=3D 0); + return EFI_UNSUPPORTED; + } + + // + // Check parameters + // + if ((CommBuffer =3D=3D NULL) || (CommSize =3D=3D NULL)) { + ASSERT (CommBuffer !=3D NULL); + ASSERT (CommSize !=3D NULL); + return EFI_INVALID_PARAMETER; + } + + // If the length of the CommBuffer is 0 then return the expected length. + // This case can be used by the consumer of this driver to find out the + // max size that can be used for allocating CommBuffer. + if ((*CommSize =3D=3D 0) || (*CommSize > (UINTN)PcdGet64 (PcdMmBufferSiz= e))) { + DEBUG (( + DEBUG_ERROR, + "%a Invalid CommSize value 0x%llx!\n", + __func__, + *CommSize + )); + *CommSize =3D (UINTN)PcdGet64 (PcdMmBufferSize); + return EFI_BAD_BUFFER_SIZE; + } + + // Given CommBuffer is not NULL here, we use it to test the legitimacy o= f CommSize. + TempCommHeader =3D (EFI_MM_COMMUNICATE_HEADER *)(UINTN)CommBuffer; + + // CommBuffer is a mandatory parameter. Hence, Rely on + // MessageLength + Header to ascertain the + // total size of the communication payload rather than + // rely on optional CommSize parameter + BufferSize =3D TempCommHeader->MessageLength + + sizeof (TempCommHeader->HeaderGuid) + + sizeof (TempCommHeader->MessageLength); + + // + // If CommSize is supplied it must match MessageLength + sizeof (EFI_MM_= COMMUNICATE_HEADER); + // + if (*CommSize !=3D BufferSize) { + DEBUG (( + DEBUG_ERROR, + "%a Unexpected CommSize value, has: 0x%llx vs. expected: 0x%llx!\n", + __func__, + *CommSize, + BufferSize + )); + return EFI_INVALID_PARAMETER; + } + + // Now we know that the size is something we can handle, copy it over to= the designated comm buffer. + CommunicateHeader =3D (EFI_MM_COMMUNICATE_HEADER *)(UINTN)(PcdGet64 (Pcd= MmBufferBase)); + + CopyMem (CommunicateHeader, CommBuffer, *CommSize); + + // SMC Function ID + CommunicateSmcArgs.Arg0 =3D ARM_SMC_ID_MM_COMMUNICATE_AARCH64; + + // Cookie + CommunicateSmcArgs.Arg1 =3D 0; + + // comm_buffer_address (64-bit physical address) + CommunicateSmcArgs.Arg2 =3D (UINTN)CommunicateHeader; + + // comm_size_address (not used, indicated by setting to zero) + CommunicateSmcArgs.Arg3 =3D 0; + + // Call the Standalone MM environment. + ArmCallSmc (&CommunicateSmcArgs); + + switch (CommunicateSmcArgs.Arg0) { + case ARM_SMC_MM_RET_SUCCESS: + // On successful return, the size of data being returned is inferred= from + // MessageLength + Header. + BufferSize =3D CommunicateHeader->MessageLength + + sizeof (CommunicateHeader->HeaderGuid) + + sizeof (CommunicateHeader->MessageLength); + if (BufferSize > (UINTN)PcdGet64 (PcdMmBufferSize)) { + // Something bad has happened, we should have landed in ARM_SMC_MM= _RET_NO_MEMORY + DEBUG (( + DEBUG_ERROR, + "%a Returned buffer exceeds communication buffer limit. Has: 0x%= llx vs. max: 0x%llx!\n", + __func__, + BufferSize, + (UINTN)PcdGet64 (PcdMmBufferSize) + )); + Status =3D EFI_BAD_BUFFER_SIZE; + break; + } + + CopyMem (CommBuffer, CommunicateHeader, BufferSize); + *CommSize =3D BufferSize; + Status =3D EFI_SUCCESS; + break; + + case ARM_SMC_MM_RET_INVALID_PARAMS: + Status =3D EFI_INVALID_PARAMETER; + break; + + case ARM_SMC_MM_RET_DENIED: + Status =3D EFI_ACCESS_DENIED; + break; + + case ARM_SMC_MM_RET_NO_MEMORY: + // Unexpected error since the CommSize was checked for zero length + // prior to issuing the SMC + Status =3D EFI_OUT_OF_RESOURCES; + ASSERT (0); + break; + + default: + Status =3D EFI_ACCESS_DENIED; + ASSERT (0); + break; + } + + return Status; +} + +// +// Module globals for the MM Communication PPI +// +STATIC CONST EFI_PEI_MM_COMMUNICATION_PPI mPeiMmCommunication =3D { + MmCommunicationPeim +}; + +STATIC CONST EFI_PEI_PPI_DESCRIPTOR mPeiMmCommunicationPpi =3D { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMmCommunicationPpiGuid, + (VOID*)&mPeiMmCommunication +}; + +/** + Entry point of PEI MM Communication driver + + @param FileHandle Handle of the file being invoked. + Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextF= ile(). + @param PeiServices General purpose services available to every PEIM. + + @retval EFI_SUCCESS If the interface could be successfully installed + @retval Others Returned from PeiServicesInstallPpi() +**/ +EFI_STATUS +EFIAPI +MmCommunicationPeiInitialize ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + return PeiServicesInstallPpi (&mPeiMmCommunicationPpi); +} diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 6b938ce8b671..4939b3d59b7f 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -162,6 +162,8 @@ [Components.common] ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf =20 + ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf + [Components.AARCH64] ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf diff --git a/ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf b/Arm= Pkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf new file mode 100644 index 000000000000..c74c53953901 --- /dev/null +++ b/ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf @@ -0,0 +1,40 @@ +## @file -- MmCommunicationPei.inf +# PEI MM Communicate driver +# +# Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D MmCommunicationPei + FILE_GUID =3D 58FFB346-1B75-42C7-AD69-37C652423C1A + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D MmCommunicationPeiInitialize + +[Sources] + MmCommunicationPei.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + ArmPkg/ArmPkg.dec + +[LibraryClasses] + DebugLib + ArmSmcLib + PeimEntryPoint + PeiServicesLib + HobLib + +[Pcd] + gArmTokenSpaceGuid.PcdMmBufferBase + gArmTokenSpaceGuid.PcdMmBufferSize + +[Ppis] + gEfiPeiMmCommunicationPpiGuid ## PRODUCES + +[Depex] + TRUE --=20 2.41.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106444): https://edk2.groups.io/g/devel/message/106444 Mute This Topic: https://groups.io/mt/99820283/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 16 06:01:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106445+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106445+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1687907670; cv=none; d=zohomail.com; s=zohoarc; b=W1eCNxh4XPJFYM78cxRPmr1Gt4lHLNDYrA4TujLTwPkUzsVmO+NnqXHdL+n0ljeh6JBY8RijMDWpIwNE3BMqDyMtc2UMAmqcAD6faz7hbrr0q3djfXmL2Zo3uPR+1tD+ZkKZyJKYDWKFr9oKiDxyoeLhLForErX+61C0tL/HGx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687907670; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=/dhqmdRC0MX3WkacTUWhwcPLCgi2wDzGoWE9IMgNsFY=; b=YEhlk74Lv0jV0bU0Q5OQml5mxztv4nq6r8/buW8BXxYzX321eo7xaBFXXyHCwWDEHP3O/5XUsAnnfK3wR8+a/LOUi9T3iQm2izstTKFsJjloZevroNs1IPCSRfz3hJ+LP0x3xHF7MoavKEjAJHESln9BHljMgOuQEqvi4oGZ17Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106445+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1687907670675156.223739459542; Tue, 27 Jun 2023 16:14:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XT5gYY1788612xLLbRQznGIt; Tue, 27 Jun 2023 16:14:30 -0700 X-Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mx.groups.io with SMTP id smtpd.web10.3900.1687907669498745346 for ; Tue, 27 Jun 2023 16:14:29 -0700 X-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1b8063aa2e1so17743375ad.1 for ; Tue, 27 Jun 2023 16:14:29 -0700 (PDT) X-Gm-Message-State: ot1JoeROTuToLc2wGikQM0dpx1787277AA= X-Google-Smtp-Source: ACHHUZ6oU78UY516qGm17QLA6kv2eeXzy+oV7QsDpZfaUQgpTLE6HuEj+QXq5B96+m0n/cuUAZEQ9A== X-Received: by 2002:a17:903:1c1:b0:1b3:ad86:ed17 with SMTP id e1-20020a17090301c100b001b3ad86ed17mr8592805plh.9.1687907668595; Tue, 27 Jun 2023 16:14:28 -0700 (PDT) X-Received: from MININT-0U7P5GU.redmond.corp.microsoft.com ([2001:4898:80e8:9:6107:268c:453f:a14b]) by smtp.gmail.com with ESMTPSA id bj8-20020a170902850800b001b7fa81b145sm4768947plb.265.2023.06.27.16.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 16:14:28 -0700 (PDT) From: "Kun Qin" To: devel@edk2.groups.io Cc: Hao A Wu , Liming Gao , Jian J Wang , Ronny Hansen , Shriram Masanamuthu Chinnathurai , Preshit Harlikar Subject: [edk2-devel] [PATCH v3 2/2] MdeModulePkg: Variable: Introduce MM based variable read service in PEI Date: Tue, 27 Jun 2023 16:14:20 -0700 Message-ID: <20230627231421.1956-3-kuqin12@gmail.com> In-Reply-To: <20230627231421.1956-1-kuqin12@gmail.com> References: <20230627231421.1956-1-kuqin12@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kuqin12@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1687907670; bh=8eKFzZ+20rirm019i42SnA25aH5fR55VATnpclsfSlk=; h=Cc:Date:From:Reply-To:Subject:To; b=MUKESmb6t7GpXNrt+DF+kZumHNZ3H8lUfuqfJyjvi1rwLxtuql5hH09Eb9ubs42TjD/ 49Y+3k/bEPCCRT/mB2nG9KFPMhDPDeTGs7Cd3uh4ucrX9gj0nCYCZp7NDz+u0zRK0aTaA pRNMH3g2Rpi1wURyyBIb4fVE47dUS5QZKdw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687907672867100011 Content-Type: text/plain; charset="utf-8" From: Kun Qin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4464 This change introduced the Standalone MM based variable read capability in PEI phase for applicable platforms (such as ARM platforms). Similar to the x86 counterpart, MM communicate PPI is used to request variable information from Standalone MM environment. Cc: Hao A Wu Cc: Liming Gao Cc: Jian J Wang Co-authored-by: Ronny Hansen Co-authored-by: Shriram Masanamuthu Chinnathurai Co-authored-by: Preshit Harlikar Signed-off-by: Kun Qin Reviewed-by: Liming Gao --- Notes: v2: - Removed unused PCD [Liming] =20 v3: - Added reviewed-by tag [Liming] MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.c | 381 ++++= ++++++++++++++++ MdeModulePkg/MdeModulePkg.dsc | 1 + MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.h | 134 ++++= +++ MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.inf | 40 ++ 4 files changed, 556 insertions(+) diff --git a/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.c = b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.c new file mode 100644 index 000000000000..4f937e22e89e --- /dev/null +++ b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.c @@ -0,0 +1,381 @@ +/** @file -- MmVariablePei.c + Provides interface for reading Secure System Variables during PEI. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
+ SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include "MmVariablePei.h" + +#define MM_VARIABLE_COMM_BUFFER_OFFSET (SMM_COMMUNICATE_HEADER_SIZE + SMM= _VARIABLE_COMMUNICATE_HEADER_SIZE) + +// +// Module globals +// +EFI_PEI_READ_ONLY_VARIABLE2_PPI mPeiSecureVariableRead =3D { + PeiMmGetVariable, + PeiMmGetNextVariableName +}; + +EFI_PEI_PPI_DESCRIPTOR mPeiMmVariablePpi =3D { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiReadOnlyVariable2PpiGuid, + &mPeiSecureVariableRead +}; + +/** + Entry point of PEI Secure Variable read driver + + @param FileHandle Handle of the file being invoked. + Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextF= ile(). + @param PeiServices General purpose services available to every PEIM. + + @retval EFI_SUCCESS If the interface could be successfully installed + @retval Others Returned from PeiServicesInstallPpi() +**/ +EFI_STATUS +EFIAPI +PeiMmVariableInitialize ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + return PeiServicesInstallPpi (&mPeiMmVariablePpi); +} + +/** + Helper function to populate MM communicate header and variable communica= te header + and then communicate to PEI. + + @param[in, out] CommunicateBuffer Size of the variable name. + @param[in] CommunicateBufferSize The entire buffer size to be sen= t to MM. + @param[in] Function The MM variable function value. + + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_SUCCESS Find the specified variable. + @retval Others Errors returned by MM communicate or = variable service. + +**/ +EFI_STATUS +PopulateHeaderAndCommunicate ( + IN OUT UINT8 *CommunicateBuffer, + IN UINTN CommunicateBufferSize, + IN UINTN Function + ) +{ + EFI_STATUS Status; + EFI_PEI_MM_COMMUNICATION_PPI *MmCommunicationPpi; + EFI_MM_COMMUNICATE_HEADER *MmCommunicateHeader; + SMM_VARIABLE_COMMUNICATE_HEADER *MmVarCommsHeader; + + // Minimal sanity check + if ((CommunicateBuffer =3D=3D NULL) || + (CommunicateBufferSize < MM_VARIABLE_COMM_BUFFER_OFFSET)) + { + Status =3D EFI_INVALID_PARAMETER; + DEBUG ((DEBUG_ERROR, "%a: Invalid incoming parameters: %p and 0x%x\n",= __func__, CommunicateBuffer, CommunicateBufferSize)); + goto Exit; + } + + if ((Function !=3D SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME) && + (Function !=3D SMM_VARIABLE_FUNCTION_GET_VARIABLE)) + { + Status =3D EFI_INVALID_PARAMETER; + DEBUG ((DEBUG_ERROR, "%a: Invalid function value: 0x%x\n", __func__, F= unction)); + goto Exit; + } + + Status =3D PeiServicesLocatePpi (&gEfiPeiMmCommunicationPpiGuid, 0, NULL= , (VOID **)&MmCommunicationPpi); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Failed to locate PEI MM Communication PPI: %= r\n", __func__, Status)); + goto Exit; + } + + // Zero the entire Communication Buffer Header + MmCommunicateHeader =3D (EFI_MM_COMMUNICATE_HEADER *)CommunicateBuffer; + + ZeroMem (MmCommunicateHeader, SMM_COMMUNICATE_HEADER_SIZE); + + // Use gEfiSmmVariableProtocolGuid to request the MM variable service in= Standalone MM + CopyMem ((VOID *)&MmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProto= colGuid, sizeof (GUID)); + + // Program the MM header size + MmCommunicateHeader->MessageLength =3D CommunicateBufferSize - SMM_COMMU= NICATE_HEADER_SIZE; + + MmVarCommsHeader =3D (SMM_VARIABLE_COMMUNICATE_HEADER *)(CommunicateBuff= er + SMM_COMMUNICATE_HEADER_SIZE); + + // We are only supporting GetVariable and GetNextVariableName + MmVarCommsHeader->Function =3D Function; + + // Send the MM request using MmCommunicationPei + Status =3D MmCommunicationPpi->Communicate (MmCommunicationPpi, Communic= ateBuffer, &CommunicateBufferSize); + if (EFI_ERROR (Status)) { + // Received an error from MM interface. + DEBUG ((DEBUG_ERROR, "%a - MM Interface Error: %r\n", __func__, Status= )); + goto Exit; + } + + // MM request was successfully handled by the framework. + // Set status to the Variable Service Status Code + Status =3D MmVarCommsHeader->ReturnStatus; + if (EFI_ERROR (Status)) { + // We received an error from Variable Service. + // We cant do anymore so return Status + if (Status !=3D EFI_BUFFER_TOO_SMALL) { + DEBUG ((DEBUG_ERROR, "%a - Variable Service Error: %r\n", __func__, = Status)); + } + + goto Exit; + } + +Exit: + return Status; +} + +/** + This service retrieves a variable's value using its name and GUID. + + This function is using the Secure Variable Store. If the Data + buffer is too small to hold the contents of the variable, the error + EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the required buf= fer + size to obtain the data. + + @param This A pointer to this instance of the EFI_PEI_= READ_ONLY_VARIABLE2_PPI. + @param VariableName A pointer to a null-terminated string that= is the variable's name. + @param VariableGuid A pointer to an EFI_GUID that is the varia= ble's GUID. The combination of + VariableGuid and VariableName must be uniq= ue. + @param Attributes If non-NULL, on return, points to the vari= able's attributes. + @param DataSize On entry, points to the size in bytes of t= he Data buffer. + On return, points to the size of the data = returned in Data. + @param Data Points to the buffer which will hold the r= eturned variable value. + May be NULL with a zero DataSize in order = to determine the size of the buffer needed. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable was not found. + @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resultin= g data. + DataSize is updated with the size required= for + the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Da= ta is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved becaus= e of a device error. + +**/ +EFI_STATUS +EFIAPI +PeiMmGetVariable ( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VariableGuid, + OUT UINT32 *Attributes, OPTIONAL + IN OUT UINTN *DataSize, + OUT VOID *Data OPTIONAL + ) +{ + EFI_STATUS Status; + UINTN MessageSize; + SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE *MmVarAccessHeader; + UINT8 *MmCommunicateBuffer; + UINTN RequiredPages; + + // Check input parameters + if ((VariableName =3D=3D NULL) || (VariableGuid =3D=3D NULL) || (DataSiz= e =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + if (VariableName[0] =3D=3D 0) { + return EFI_NOT_FOUND; + } + + if ((*DataSize > 0) && (Data =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + // Allocate required pages to send MM request + MessageSize =3D MM_VARIABLE_COMM_BUFFER_OFFSET + + OFFSET_OF (SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE, Name)= + + StrSize (VariableName) + *DataSize; + + RequiredPages =3D EFI_SIZE_TO_PAGES (MessageSize); + MmCommunicateBuffer =3D (UINT8 *)AllocatePages (RequiredPages); + + if (MmCommunicateBuffer =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory: %r\n", __func__, = Status)); + return Status; + } + + // Zero the entire Communication Buffer + ZeroMem (MmCommunicateBuffer, (RequiredPages * EFI_PAGE_SIZE)); + + // + // Program all payload structure contents + // + MmVarAccessHeader =3D (SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE *)(MmCom= municateBuffer + MM_VARIABLE_COMM_BUFFER_OFFSET); + + // Variable GUID + CopyMem ((VOID *)&MmVarAccessHeader->Guid, VariableGuid, sizeof (GUID)); + + // Program the max amount of data we accept. + MmVarAccessHeader->DataSize =3D *DataSize; + + // Get size of the variable name + MmVarAccessHeader->NameSize =3D StrSize (VariableName); + + // Populate incoming variable name + CopyMem ((VOID *)&MmVarAccessHeader->Name, VariableName, MmVarAccessHead= er->NameSize); + + Status =3D PopulateHeaderAndCommunicate (MmCommunicateBuffer, MessageSiz= e, SMM_VARIABLE_FUNCTION_GET_VARIABLE); + if (EFI_ERROR (Status)) { + // We received an error from either communicate or Variable Service. + if (Status !=3D EFI_BUFFER_TOO_SMALL) { + DEBUG ((DEBUG_ERROR, "%a - Communite to MM for variable service erro= red: %r\n", __func__, Status)); + } + + goto Exit; + } + + Status =3D EFI_SUCCESS; + + // User provided buffer is too small + if (*DataSize < MmVarAccessHeader->DataSize) { + Status =3D EFI_BUFFER_TOO_SMALL; + } + +Exit: + // Check if we need to set Attributes + if (Attributes !=3D NULL) { + *Attributes =3D MmVarAccessHeader->Attributes; + } + + *DataSize =3D MmVarAccessHeader->DataSize; + + if (Status =3D=3D EFI_SUCCESS) { + CopyMem ((VOID *)Data, (UINT8 *)MmVarAccessHeader->Name + MmVarAccessH= eader->NameSize, *DataSize); + } + + // Free the Communication Buffer + if (MmCommunicateBuffer !=3D NULL) { + FreePages (MmCommunicateBuffer, RequiredPages); + } + + return Status; +} + +/** + Return the next variable name and GUID. + + This function is called multiple times to retrieve the VariableName + and VariableGuid of all variables currently available in the system. + On each call, the previous results are passed into the interface, + and, on return, the interface returns the data for the next + interface. When the entire variable list has been returned, + EFI_NOT_FOUND is returned. + + @param This A pointer to this instance of the EFI_PEI_READ= _ONLY_VARIABLE2_PPI. + + @param VariableNameSize On entry, points to the size of the buffer poi= nted to by VariableName. + On return, the size of the variable name buffe= r. + @param VariableName On entry, a pointer to a null-terminated strin= g that is the variable's name. + On return, points to the next variable's null-= terminated name string. + + @param VariableGuid On entry, a pointer to an EFI_GUID that is the= variable's GUID. + On return, a pointer to the next variable's GU= ID. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable could not be found. + @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the = resulting + data. VariableNameSize is updated with the= size + required for the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or + VariableNameSize is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved becaus= e of a device error. +**/ +EFI_STATUS +EFIAPI +PeiMmGetNextVariableName ( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VariableGuid + ) +{ + EFI_STATUS Status; + UINTN MessageSize; + UINT8 *MmCommunicateBuffer; + SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME *MmVarGetNextVarHeader; + UINTN RequiredPages; + + // Check input parameters + if ((VariableName =3D=3D NULL) || + (VariableGuid =3D=3D NULL) || + (VariableNameSize =3D=3D NULL) || + (*VariableNameSize =3D=3D 0)) + { + return EFI_INVALID_PARAMETER; + } + + // Allocate required pages to send MM request + MessageSize =3D MM_VARIABLE_COMM_BUFFER_OFFSET + + OFFSET_OF (SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE, Name)= + + StrSize (VariableName) + *VariableNameSize; + + RequiredPages =3D EFI_SIZE_TO_PAGES (MessageSize); + MmCommunicateBuffer =3D (UINT8 *)AllocatePages (RequiredPages); + + if (MmCommunicateBuffer =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory: %r\n", __func__, = Status)); + return Status; + } + + // Zero the entire Communication Buffer + ZeroMem (MmCommunicateBuffer, (RequiredPages * EFI_PAGE_SIZE)); + + // + // Program all payload structure contents + // + MmVarGetNextVarHeader =3D (SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NA= ME *)(MmCommunicateBuffer + MM_VARIABLE_COMM_BUFFER_OFFSET); + + // Variable GUID + CopyMem ((VOID *)&MmVarGetNextVarHeader->Guid, VariableGuid, sizeof (GUI= D)); + + // Program the maximal length of name we can accept. + MmVarGetNextVarHeader->NameSize =3D *VariableNameSize; + + // Populate incoming variable name + CopyMem ((VOID *)&MmVarGetNextVarHeader->Name, VariableName, MmVarGetNex= tVarHeader->NameSize); + + // Send the MM request using MmCommunicationPei + Status =3D PopulateHeaderAndCommunicate (MmCommunicateBuffer, MessageSiz= e, SMM_VARIABLE_FUNCTION_GET_NEXT_VARIABLE_NAME); + if (EFI_ERROR (Status)) { + // We received an error from either communicate or Variable Service. + if (Status !=3D EFI_BUFFER_TOO_SMALL) { + DEBUG ((DEBUG_ERROR, "%a - Communite to MM for variable service erro= red: %r\n", __func__, Status)); + } + + goto Exit; + } + + Status =3D EFI_SUCCESS; + + // User provided buffer is too small + if (*VariableNameSize < MmVarGetNextVarHeader->NameSize) { + Status =3D EFI_BUFFER_TOO_SMALL; + } + +Exit: + // Update the name size to be returned + *VariableNameSize =3D MmVarGetNextVarHeader->NameSize; + + if (Status =3D=3D EFI_SUCCESS) { + CopyMem ((VOID *)VariableName, (UINT8 *)MmVarGetNextVarHeader->Name, *= VariableNameSize); + CopyMem ((VOID *)VariableGuid, (UINT8 *)&(MmVarGetNextVarHeader->Guid)= , sizeof (EFI_GUID)); + } + + // Free the Communication Buffer + if (MmCommunicateBuffer !=3D NULL) { + FreePages (MmCommunicateBuffer, RequiredPages); + } + + return Status; +} diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 5b1f50e9c084..1aedfe280ae1 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -400,6 +400,7 @@ [Components] MdeModulePkg/Application/VariableInfo/VariableInfo.inf MdeModulePkg/Universal/FaultTolerantWritePei/FaultTolerantWritePei.inf MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.inf MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf MdeModulePkg/Universal/TimestampDxe/TimestampDxe.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf diff --git a/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.h = b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.h new file mode 100644 index 000000000000..0feed8cd1cb6 --- /dev/null +++ b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.h @@ -0,0 +1,134 @@ +/** @file -- MmVariablePei.h + Provides interface for reading Secure System Variables during PEI. + + Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef PEI_MM_VARIABLE_LIB_H_ +#define PEI_MM_VARIABLE_LIB_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +/** + Entry point of PEI Secure Variable read driver + + @param FileHandle Handle of the file being invoked. + Type EFI_PEI_FILE_HANDLE is defined in FfsFindNextF= ile(). + @param PeiServices General purpose services available to every PEIM. + + @retval EFI_SUCCESS If the interface could be successfully installed + @retval Others Returned from PeiServicesInstallPpi() +**/ +EFI_STATUS +EFIAPI +PeiMmVariableInitialize ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ); + +/** + + This function enables the read of Secure Variables during PEI. + + This function is using the Secure Variable Store.If the Data + buffer is too small to hold the contents of the variable, the error + EFI_BUFFER_TOO_SMALL is returned and DataSize is set to the required buf= fer + size to obtain the data. + + The function performs the following: + + 1) Creates an MM request + 2) Fills out the following data structures for the Secure Variable Servi= ce + SMM_VARIABLE_COMMUNICATE_HEADER/SMM_VARIABLE_COMMUNICATE_ACCESS_VARI= ABLE + 3) Adds the MM data structures to the MM request. + 4) Sends the MM request to EL3 using MmCommunicationPeiLib. + 5) The MM request is sent to S-EL0. + 6) The MM request is then handled by the registered handler with GUID: g= EfiSmmVariableProtocolGuid + + @param This A pointer to this instance of the EFI_PEI_= READ_ONLY_VARIABLE2_PPI. + @param VariableName A pointer to a null-terminated string that= is the variable's name. + @param VariableGuid A pointer to an EFI_GUID that is the varia= ble's GUID. The combination of + VariableGuid and VariableName must be uniq= ue. + @param Attributes If non-NULL, on return, points to the vari= able's attributes. + @param DataSize On entry, points to the size in bytes of t= he Data buffer. + On return, points to the size of the data = returned in Data. + @param Data Points to the buffer which will hold the r= eturned variable value. + May be NULL with a zero DataSize in order = to determine the size of the buffer needed. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable was not found. + @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the resultin= g data. + DataSize is updated with the size required= for + the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid, DataSize or Da= ta is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved becaus= e of a device error. + +**/ +EFI_STATUS +EFIAPI +PeiMmGetVariable ( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VariableGuid, + OUT UINT32 *Attributes, + IN OUT UINTN *DataSize, + OUT VOID *Data OPTIONAL + ); + +/** + Return the next variable name and GUID. + + This function is called multiple times to retrieve the VariableName + and VariableGuid of all variables currently available in the system. + On each call, the previous results are passed into the interface, + and, on return, the interface returns the data for the next + interface. When the entire variable list has been returned, + EFI_NOT_FOUND is returned. + + @param This A pointer to this instance of the EFI_PEI_READ= _ONLY_VARIABLE2_PPI. + + @param VariableNameSize On entry, points to the size of the buffer poi= nted to by VariableName. + On return, the size of the variable name buffe= r. + @param VariableName On entry, a pointer to a null-terminated strin= g that is the variable's name. + On return, points to the next variable's null-= terminated name string. + + @param VariableGuid On entry, a pointer to an EFI_GUID that is the= variable's GUID. + On return, a pointer to the next variable's GU= ID. + + @retval EFI_SUCCESS The variable was read successfully. + @retval EFI_NOT_FOUND The variable could not be found. + @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the = resulting + data. VariableNameSize is updated with the= size + required for the specified variable. + @retval EFI_INVALID_PARAMETER VariableName, VariableGuid or + VariableNameSize is NULL. + @retval EFI_DEVICE_ERROR The variable could not be retrieved becaus= e of a device error. +**/ +EFI_STATUS +EFIAPI +PeiMmGetNextVariableName ( + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VariableGuid + ); + +#endif /* PEI_MM_VARIABLE_LIB_H_ */ diff --git a/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.in= f b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.inf new file mode 100644 index 000000000000..13e80523f960 --- /dev/null +++ b/MdeModulePkg/Universal/Variable/MmVariablePei/MmVariablePei.inf @@ -0,0 +1,40 @@ +## @file -- MmVariablePei.inf +# Provides interface for reading Secure System Variables during PEI. +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D MmVariablePei + FILE_GUID =3D CD660A87-454B-4346-A35C-3D89BF8ECFAF + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PeiMmVariableInitialize + +[Sources] + MmVariablePei.c + MmVariablePei.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + PcdLib + PeiServicesLib + PeimEntryPoint + MemoryAllocationLib + HobLib + +[Protocols] + gEfiSmmVariableProtocolGuid ## CONSUMES + +[Ppis] + gEfiPeiReadOnlyVariable2PpiGuid ## PRODUCES + gEfiPeiMmCommunicationPpiGuid ## CONSUMES + +[Depex] + gEfiPeiMmCommunicationPpiGuid --=20 2.41.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106445): https://edk2.groups.io/g/devel/message/106445 Mute This Topic: https://groups.io/mt/99820286/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-