From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.35400.1629783285445206171 for ; Mon, 23 Aug 2021 22:34:45 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: omkar.kulkarni@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A1DE1042; Mon, 23 Aug 2021 22:34:45 -0700 (PDT) Received: from usa.arm.com (a077433.blr.arm.com [10.162.46.10]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DADA93F766; Mon, 23 Aug 2021 22:34:43 -0700 (PDT) From: "Omkar Anand Kulkarni" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-platforms][PATCH v3 2/5] ArmPlatformPkg: add definition for MM_HEST_ERROR_SOURCE_DESC_PROTOCOL Date: Tue, 24 Aug 2021 11:04:00 +0530 Message-Id: <20210824053403.24103-3-omkar.kulkarni@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210824053403.24103-1-omkar.kulkarni@arm.com> References: <20210824053403.24103-1-omkar.kulkarni@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Add the protocol definition of the MM_HEST_ERROR_SOURCE_DESC_PROTOCOL protocol. This protocol can be implemented by MM drivers to publish error source descriptors that have to be populated into HEST table. Co-authored-by: Thomas Abraham Signed-off-by: Omkar Anand Kulkarni --- ArmPlatformPkg/ArmPlatformPkg.dec | 3 + ArmPlatformPkg/Include/Protocol/HestErrorSourceInfo.h | 64 +++++++++++++= +++++++ 2 files changed, 67 insertions(+) diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatfo= rmPkg.dec index 3a25ddcdc8ca..446d93b880f9 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -127,3 +127,6 @@ gArmPlatformTokenSpaceGuid.PcdPL031RtcPpmAccuracy|300000000|UINT32|0x0= 0000022 =20 gArmPlatformTokenSpaceGuid.PcdWatchdogCount|0x0|UINT32|0x00000033 + +[Protocols.common] + gMmHestErrorSourceDescProtocolGuid =3D { 0x560bf236, 0xa4a8, 0x4d69, {= 0xbc, 0xf6, 0xc2, 0x97, 0x24, 0x10, 0x9d, 0x91 } } diff --git a/ArmPlatformPkg/Include/Protocol/HestErrorSourceInfo.h b/ArmP= latformPkg/Include/Protocol/HestErrorSourceInfo.h new file mode 100644 index 000000000000..86662ea7af57 --- /dev/null +++ b/ArmPlatformPkg/Include/Protocol/HestErrorSourceInfo.h @@ -0,0 +1,64 @@ +/** @file + MM protocol to get the secure error source descriptor information. + + MM Drivers must implement this protocol in order to publish secure sid= e + error source descriptor information to OSPM through the HEST ACPI tabl= e. + + Copyright (c) 2020 - 2021, ARM Limited. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef MM_HEST_ERROR_SOURCE_DESC_ +#define MM_HEST_ERROR_SOURCE_DESC_ + +#define MM_HEST_ERROR_SOURCE_DESC_PROTOCOL_GUID \ + { \ + 0x560bf236, 0xa4a8, 0x4d69, { 0xbc, 0xf6, 0xc2, 0x97, 0x24, 0x10, 0x= 9d, 0x91 } \ + } + +typedef struct MmHestErrorSourceDescProtocol + MM_HEST_ERROR_SOURCE_DESC_PROTOCOL; + +/** + Get HEST Secure Error Source Descriptors. + + The MM drivers implementing this protocol must convey the total count = and + total length of the error sources the driver has along with the actual= error + source descriptor(s). + + Passing NULL as Buffer parameter shall return EFI_INVALID_PARAMETR wit= h the + total length and count of the error source descriptor(s) it supports. + + @param[in] This MM_HEST_ERROR_SOURCE_DESC_PROTOCOL in= stance. + @param[out] Buffer Buffer to be appended with the error + source descriptors information. + @param[out] ErrorSourcesLength Total length of all the error source + descriptors. + @param[out] ErrorSourceCount Count of total error source descripto= rs + supported by the driver. + + retval EFI_SUCCESS If the Buffer is valid and is filled wit= h valid + Error Source descriptor data. + retval EFI_INVALID_PARAMTER Buffer is NULL. + retval Other If no error source descriptor informatio= n is + available. +**/ +typedef +EFI_STATUS +(EFIAPI *MM_HEST_GET_ERROR_SOURCE_DESCRIPTORS) ( + IN MM_HEST_ERROR_SOURCE_DESC_PROTOCOL *This, + OUT VOID **Buffer, + OUT UINTN *ErrorSourcesLength, + OUT UINTN *ErrorSourcesCount + ); + +// +// Protocol declaration +// +struct MmHestErrorSourceDescProtocol { + MM_HEST_GET_ERROR_SOURCE_DESCRIPTORS GetHestErrorSourceDescriptors; +}; + +extern EFI_GUID gMmHestErrorSourceDescProtocolGuid; + +#endif // MM_HEST_ERROR_SOURCE_DESC_ --=20 2.17.1