[edk2-devel] [PATCH 5/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add header file.

Yao, Jiewen jiewen.yao at intel.com
Sun Aug 2 08:39:51 UTC 2020


Hi Qi
We should hide MeasureFspFirmwareBlobWithCfg() as an internal function.
The MeasureFspFirmwareBlob() should decide hash FV with or without CFG based upon PCD.



> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang at intel.com>
> Sent: Friday, July 31, 2020 4:55 PM
> To: devel at edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao at intel.com>; Chiu, Chasel <chasel.chiu at intel.com>;
> Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Zeng, Star
> <star.zeng at intel.com>; Zhang, Qi1 <qi1.zhang at intel.com>
> Subject: [PATCH 5/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add header file.
> 
> From: Jiewen Yao <jiewen.yao at intel.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2376
> 
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> Cc: Chasel Chiu <chasel.chiu at intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
> Cc: Star Zeng <star.zeng at intel.com>
> Cc: Qi Zhang <qi1.zhang at intel.com>
> Signed-off-by: Jiewen Yao <jiewen.yao at intel.com>
> ---
>  .../Include/Library/FspMeasurementLib.h       | 65 +++++++++++++++++++
>  1 file changed, 65 insertions(+)
>  create mode 100644
> IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
> 
> diff --git a/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
> b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
> new file mode 100644
> index 0000000000..ca02ecdf1f
> --- /dev/null
> +++ b/IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h
> @@ -0,0 +1,65 @@
> +/** @file
> 
> +  This library is used by FSP modules to measure data to TPM.
> 
> +
> 
> +Copyright (c) 2020, Intel Corporation. All rights reserved. <BR>
> 
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +
> 
> +**/
> 
> +
> 
> +#ifndef _FSP_MEASUREMENT_LIB_H_
> 
> +#define _FSP_MEASUREMENT_LIB_H_
> 
> +
> 
> +#define FSP_MEASURE_FSP       BIT0
> 
> +#define FSP_MEASURE_FSPT      BIT1
> 
> +#define FSP_MEASURE_FSPM      BIT2
> 
> +#define FSP_MEASURE_FSPS      BIT3
> 
> +#define FSP_MEASURE_FSPUPD    BIT31
> 
> +
> 
> +/**
> 
> +  Mesure a FSP FirmwareBlob.
> 
> +
> 
> +  @param[in]  PcrIndex                PCR Index.
> 
> +  @param[in]  Descrption              Description for this FirmwareBlob.
> 
> +  @param[in]  FirmwareBlobBase        Base address of this FirmwareBlob.
> 
> +  @param[in]  FirmwareBlobLength      Size in bytes of this FirmwareBlob.
> 
> +
> 
> +  @retval EFI_SUCCESS           Operation completed successfully.
> 
> +  @retval EFI_UNSUPPORTED       TPM device not available.
> 
> +  @retval EFI_OUT_OF_RESOURCES  Out of memory.
> 
> +  @retval EFI_DEVICE_ERROR      The operation was unsuccessful.
> 
> +*/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MeasureFspFirmwareBlob (
> 
> +  IN UINT32                         PcrIndex,
> 
> +  IN CHAR8                          *Description OPTIONAL,
> 
> +  IN EFI_PHYSICAL_ADDRESS           FirmwareBlobBase,
> 
> +  IN UINT64                         FirmwareBlobLength
> 
> +  );
> 
> +
> 
> +/**
> 
> +  Mesure a FSP FirmwareBlob.
> 
> +
> 
> +  @param[in]  PcrIndex                PCR Index.
> 
> +  @param[in]  Descrption              Description for this FirmwareBlob.
> 
> +  @param[in]  FirmwareBlobBase        Base address of this FirmwareBlob.
> 
> +  @param[in]  FirmwareBlobLength      Size in bytes of this FirmwareBlob.
> 
> +  @param[in]  CfgRegionOffset         Configuration region offset in bytes.
> 
> +  @param[in]  CfgRegionSize           Configuration region in bytes.
> 
> +
> 
> +  @retval EFI_SUCCESS           Operation completed successfully.
> 
> +  @retval EFI_UNSUPPORTED       TPM device not available.
> 
> +  @retval EFI_OUT_OF_RESOURCES  Out of memory.
> 
> +  @retval EFI_DEVICE_ERROR      The operation was unsuccessful.
> 
> +*/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MeasureFspFirmwareBlobWithCfg (
> 
> +  IN CHAR8                          *Description OPTIONAL,
> 
> +  IN EFI_PHYSICAL_ADDRESS           FirmwareBlobBase,
> 
> +  IN UINT64                         FirmwareBlobLength,
> 
> +  IN UINT32                         CfgRegionOffset,
> 
> +  IN UINT32                         CfgRegionSize
> 
> +  );
> 
> +
> 
> +#endif
> 
> --
> 2.26.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63633): https://edk2.groups.io/g/devel/message/63633
Mute This Topic: https://groups.io/mt/75903683/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list