summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Include
diff options
context:
space:
mode:
authorMin Xu <min.m.xu@intel.com>2022-05-16 15:42:18 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-06-03 11:41:36 +0000
commita708536dce4d4095b44d48fb9a90e89b11362e83 (patch)
tree74b4efef69bf010085233db5551dd496875f89bd /OvmfPkg/Include
parentdc443e4437d0ec58aa0bf81ff91d11f1b30ac63f (diff)
downloadedk2-a708536dce4d4095b44d48fb9a90e89b11362e83.tar.gz
edk2-a708536dce4d4095b44d48fb9a90e89b11362e83.tar.bz2
edk2-a708536dce4d4095b44d48fb9a90e89b11362e83.zip
OvmfPkg: Introduce SecMeasurementLib
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3853 SecMeasurementLib is designed to do the measurement in SEC phase. In current stage there are 2 functions introduced: - MeasureHobList: Measure the Hoblist passed from the VMM. - MeasureFvImage: Measure the FV image. SecMeasurementLibTdx is the TDX version of the library. Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Ken Lu <ken.lu@intel.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'OvmfPkg/Include')
-rw-r--r--OvmfPkg/Include/Library/SecMeasurementLib.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Library/SecMeasurementLib.h b/OvmfPkg/Include/Library/SecMeasurementLib.h
new file mode 100644
index 0000000000..ca7a7dc3a9
--- /dev/null
+++ b/OvmfPkg/Include/Library/SecMeasurementLib.h
@@ -0,0 +1,46 @@
+/** @file
+
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef SEC_MEASUREMENT_LIB_H_
+#define SEC_MEASUREMENT_LIB_H_
+
+/**
+ Measure the Hoblist passed from the VMM.
+
+ @param[in] VmmHobList The Hoblist pass the firmware
+
+ @retval EFI_SUCCESS Fv image is measured successfully
+ or it has been already measured.
+ @retval Others Other errors as indicated
+**/
+EFI_STATUS
+EFIAPI
+MeasureHobList (
+ IN CONST VOID *VmmHobList
+ );
+
+/**
+ Measure FV image.
+
+ @param[in] FvBase Base address of FV image.
+ @param[in] FvLength Length of FV image.
+ @param[in] PcrIndex Index of PCR
+
+ @retval EFI_SUCCESS Fv image is measured successfully
+ or it has been already measured.
+ @retval Others Other errors as indicated
+**/
+EFI_STATUS
+EFIAPI
+MeasureFvImage (
+ IN EFI_PHYSICAL_ADDRESS FvBase,
+ IN UINT64 FvLength,
+ IN UINT8 PcrIndex
+ );
+
+#endif