[edk2-devel] [PATCH v1 2/3] MdeModulePkg/Variable: Consume Variable Info HOB

Wu, Hao A hao.a.wu at intel.com
Thu Apr 7 03:31:48 UTC 2022


One inline comment below:


> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Michael
> Kubacki
> Sent: Thursday, April 7, 2022 12:27 AM
> To: devel at edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang at intel.com>; Wu, Hao A <hao.a.wu at intel.com>;
> Gao, Liming <gaoliming at byosoft.com.cn>
> Subject: [edk2-devel] [PATCH v1 2/3] MdeModulePkg/Variable: Consume
> Variable Info HOB
> 
> From: Michael Kubacki <michael.kubacki at microsoft.com>
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479
> 
> Updates VariableRuntimeDxe, VariableSmm, and VariableStandaloneMm
> to acquire variable flash information from the Variable Flash
> Information HOB.
> 
> If the HOB is not present, the drivers will continue to directly
> read flash information from PCDs.
> 
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Hao A Wu <hao.a.wu at intel.com>
> Cc: Liming Gao <gaoliming at byosoft.com.cn>
> Signed-off-by: Michael Kubacki <michael.kubacki at microsoft.com>
> ---
>  MdeModulePkg/Universal/Variable/Pei/Variable.c                      | 66
> ++++++++++++++++++--
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c               | 42
> +++++++++++++
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c            | 25
> ++++++--
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c    | 20
> ++++--
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c            | 20
> +++++-
>  MdeModulePkg/Universal/Variable/Pei/Variable.h                      |  2 +
>  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf                 |  6 +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h               | 17 +++++
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf   |  6
> +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf          |  6 +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf |  6
> +-
>  11 files changed, 194 insertions(+), 22 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c
> b/MdeModulePkg/Universal/Variable/Pei/Variable.c
> index b36dd0de67b2..b19a26965ef2 100644
> --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c
> @@ -553,6 +553,48 @@ GetHobVariableStore (
>    }
>  }
> 
> +/**
> +  Get the HOB that contains variable flash information.
> +
> +  @param[out] VariableFlashInfo   Pointer to a pointer to set to the variable
> flash information structure.
> +
> +  @retval EFI_SUCCESS             Variable flash information was found successfully.
> +  @retval EFI_INVALID_PARAMETER   The VariableFlashInfo pointer given is
> NULL.
> +  @retval EFI_NOT_FOUND           Variable flash information could not be found.
> +
> +**/
> +EFI_STATUS
> +GetVariableFlashInfo (
> +  OUT VARIABLE_FLASH_INFO  **VariableFlashInfo
> +  )
> +{
> +  EFI_HOB_GUID_TYPE  *GuidHob;
> +
> +  if (VariableFlashInfo == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  GuidHob = GetFirstGuidHob (&gVariableFlashInfoHobGuid);
> +  if (GuidHob == NULL) {
> +    return EFI_NOT_FOUND;
> +  }
> +
> +  *VariableFlashInfo = GET_GUID_HOB_DATA (GuidHob);
> +
> +  //
> +  // Assert if more than one variable flash information HOB is present.
> +  //
> +  DEBUG_CODE (
> +    if ((GetNextGuidHob (&gVariableFlashInfoHobGuid, GET_NEXT_HOB
> (GuidHob)) != NULL)) {
> +    DEBUG ((DEBUG_ERROR, "ERROR: Found two variable flash information
> HOBs\n"));
> +    ASSERT (FALSE);
> +  }
> +
> +    );
> +
> +  return EFI_SUCCESS;
> +}
> +
>  /**
>    Return the variable store header and the store info based on the Index.
> 
> @@ -567,8 +609,10 @@ GetVariableStore (
>    OUT VARIABLE_STORE_INFO  *StoreInfo
>    )
>  {
> +  EFI_STATUS                            Status;
>    EFI_HOB_GUID_TYPE                     *GuidHob;
>    EFI_FIRMWARE_VOLUME_HEADER            *FvHeader;
> +  VARIABLE_FLASH_INFO                   *VariableFlashInfo;
>    VARIABLE_STORE_HEADER                 *VariableStoreHeader;
>    EFI_PHYSICAL_ADDRESS                  NvStorageBase;
>    UINT32                                NvStorageSize;
> @@ -591,11 +635,23 @@ GetVariableStore (
>          // Emulated non-volatile variable mode is not enabled.
>          //
> 
> -        NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);
> -        NvStorageBase = (EFI_PHYSICAL_ADDRESS)(PcdGet64
> (PcdFlashNvStorageVariableBase64) != 0 ?
> -                                               PcdGet64 (PcdFlashNvStorageVariableBase64) :
> -                                               PcdGet32 (PcdFlashNvStorageVariableBase)
> -                                               );
> +        Status = GetVariableFlashInfo (&VariableFlashInfo);
> +        if (!EFI_ERROR (Status)) {
> +          NvStorageBase = VariableFlashInfo->NvStorageBaseAddress;
> +          Status        = SafeUint64ToUint32 (VariableFlashInfo->NvStorageLength,
> &NvStorageSize);
> +          // This driver currently assumes the size will be UINT32 so only accept
> +          // that for now.
> +          ASSERT_EFI_ERROR (Status);
> +        }
> +
> +        if (EFI_ERROR (Status)) {
> +          NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);
> +          NvStorageBase = (EFI_PHYSICAL_ADDRESS)(PcdGet64
> (PcdFlashNvStorageVariableBase64) != 0 ?
> +                                                 PcdGet64 (PcdFlashNvStorageVariableBase64) :
> +                                                 PcdGet32 (PcdFlashNvStorageVariableBase)
> +                                                 );
> +        }
> +
>          ASSERT (NvStorageBase != 0);
> 
>          //
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> index 6c1a3440ac8c..6ab4efd62a7e 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> @@ -3701,6 +3701,48 @@ GetHobVariableStore (
>    return EFI_SUCCESS;
>  }
> 
> +/**
> +  Get the HOB that contains variable flash information.
> +
> +  @param[out] VariableFlashInfo   Pointer to a pointer to set to the variable
> flash information structure.
> +
> +  @retval EFI_SUCCESS             Variable flash information was found successfully.
> +  @retval EFI_INVALID_PARAMETER   The VariableFlashInfo pointer given is
> NULL.
> +  @retval EFI_NOT_FOUND           Variable flash information could not be found.
> +
> +**/
> +EFI_STATUS
> +GetVariableFlashInfo (
> +  OUT VARIABLE_FLASH_INFO  **VariableFlashInfo
> +  )
> +{
> +  EFI_HOB_GUID_TYPE  *GuidHob;
> +
> +  if (VariableFlashInfo == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  GuidHob = GetFirstGuidHob (&gVariableFlashInfoHobGuid);
> +  if (GuidHob == NULL) {
> +    return EFI_NOT_FOUND;
> +  }
> +
> +  *VariableFlashInfo = GET_GUID_HOB_DATA (GuidHob);
> +
> +  //
> +  // Assert if more than one variable flash information HOB is present.
> +  //
> +  DEBUG_CODE (
> +    if ((GetNextGuidHob (&gVariableFlashInfoHobGuid, GET_NEXT_HOB
> (GuidHob)) != NULL)) {
> +    DEBUG ((DEBUG_ERROR, "ERROR: Found two variable flash information
> HOBs\n"));
> +    ASSERT (FALSE);
> +  }
> +
> +    );
> +
> +  return EFI_SUCCESS;
> +}
> +
>  /**
>    Initializes variable store area for non-volatile and volatile variable.
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> index 03fec3048dc4..1dc121d78e35 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
> @@ -416,6 +416,7 @@ FtwNotificationEvent (
>    EFI_STATUS                          Status;
>    EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *FvbProtocol;
>    EFI_FAULT_TOLERANT_WRITE_PROTOCOL   *FtwProtocol;
> +  VARIABLE_FLASH_INFO                 *VariableFlashInfo;
>    EFI_PHYSICAL_ADDRESS                NvStorageVariableBase;
>    EFI_GCD_MEMORY_SPACE_DESCRIPTOR     GcdDescriptor;
>    EFI_PHYSICAL_ADDRESS                BaseAddress;
> @@ -423,6 +424,7 @@ FtwNotificationEvent (
>    EFI_PHYSICAL_ADDRESS                VariableStoreBase;
>    UINT64                              VariableStoreLength;
>    UINTN                               FtwMaxBlockSize;
> +  UINT32                              NvStorageVariableSize;
> 
>    //
>    // Ensure FTW protocol is installed.
> @@ -432,14 +434,29 @@ FtwNotificationEvent (
>      return;
>    }
> 
> +  Status = GetVariableFlashInfo (&VariableFlashInfo);
> +  if (!EFI_ERROR (Status)) {
> +    NvStorageVariableBase = VariableFlashInfo->NvStorageBaseAddress;
> +    Status                = SafeUint64ToUint32 (VariableFlashInfo->NvStorageLength,
> &NvStorageVariableSize);
> +    // This driver currently assumes the size will be UINT32 so only accept
> +    // that for now.
> +    ASSERT_EFI_ERROR (Status);
> +  }
> +
> +  if (EFI_ERROR (Status)) {
> +    NvStorageVariableBase = NV_STORAGE_VARIABLE_BASE;
> +    NvStorageVariableSize = PcdGet32 (PcdFlashNvStorageVariableSize);
> +  }
> +
> +  ASSERT (NvStorageVariableBase != 0);
> +
> +  VariableStoreBase = NvStorageVariableBase + mNvFvHeaderCache-
> >HeaderLength;
> +
>    Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);
>    if (!EFI_ERROR (Status)) {
> -    ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize);
> +    ASSERT (NvStorageVariableSize <= FtwMaxBlockSize);
>    }
> 
> -  NvStorageVariableBase = NV_STORAGE_VARIABLE_BASE;
> -  VariableStoreBase     = NvStorageVariableBase + mNvFvHeaderCache-
> >HeaderLength;
> -
>    //
>    // Let NonVolatileVariableBase point to flash variable store base directly after
> FTW ready.
>    //
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> index 5e9d40b67ac2..e424c210248a 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> @@ -137,6 +137,7 @@ InitRealNonVolatileVariableStore (
>  {
>    EFI_FIRMWARE_VOLUME_HEADER            *FvHeader;
>    VARIABLE_STORE_HEADER                 *VariableStore;
> +  VARIABLE_FLASH_INFO                   *VariableFlashInfo;
>    UINT32                                VariableStoreLength;
>    EFI_HOB_GUID_TYPE                     *GuidHob;
>    EFI_PHYSICAL_ADDRESS                  NvStorageBase;
> @@ -153,19 +154,30 @@ InitRealNonVolatileVariableStore (
> 
>    mVariableModuleGlobal->FvbInstance = NULL;
> 
> +  Status = GetVariableFlashInfo (&VariableFlashInfo);
> +  if (!EFI_ERROR (Status)) {
> +    NvStorageBase = VariableFlashInfo->NvStorageBaseAddress;
> +    Status        = SafeUint64ToUint32 (VariableFlashInfo->NvStorageLength,
> &NvStorageSize);
> +    // This driver currently assumes the size will be UINT32 so only accept that
> for now.
> +    ASSERT_EFI_ERROR (Status);
> +  }
> +
> +  if (EFI_ERROR (Status)) {
> +    NvStorageBase = NV_STORAGE_VARIABLE_BASE;
> +    NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);
> +  }
> +
> +  ASSERT (NvStorageBase != 0);
> +
>    //
>    // Allocate runtime memory used for a memory copy of the FLASH region.
>    // Keep the memory and the FLASH in sync as updates occur.
>    //
> -  NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);
>    NvStorageData = AllocateRuntimeZeroPool (NvStorageSize);
>    if (NvStorageData == NULL) {
>      return EFI_OUT_OF_RESOURCES;
>    }
> 
> -  NvStorageBase = NV_STORAGE_VARIABLE_BASE;
> -  ASSERT (NvStorageBase != 0);
> -
>    //
>    // Copy NV storage data to the memory buffer.
>    //
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
> index 517cae7b00f8..c8667dd6ca34 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c
> @@ -1082,8 +1082,10 @@ SmmFtwNotificationEvent (
>    EFI_PHYSICAL_ADDRESS                    VariableStoreBase;
>    EFI_SMM_FIRMWARE_VOLUME_BLOCK_PROTOCOL  *FvbProtocol;
>    EFI_SMM_FAULT_TOLERANT_WRITE_PROTOCOL   *FtwProtocol;
> +  VARIABLE_FLASH_INFO                     *VariableFlashInfo;
>    EFI_PHYSICAL_ADDRESS                    NvStorageVariableBase;
>    UINTN                                   FtwMaxBlockSize;
> +  UINT32                                  NvStorageVariableSize;
> 
>    if (mVariableModuleGlobal->FvbInstance != NULL) {
>      return EFI_SUCCESS;
> @@ -1097,9 +1099,25 @@ SmmFtwNotificationEvent (
>      return Status;
>    }
> 
> +  Status = GetVariableFlashInfo (&VariableFlashInfo);
> +  if (!EFI_ERROR (Status)) {
> +    NvStorageVariableBase = VariableFlashInfo->NvStorageBaseAddress;
> +    Status                = SafeUint64ToUint32 (VariableFlashInfo->NvStorageLength,
> &NvStorageVariableSize);
> +    // This driver currently assumes the size will be UINT32 so only accept that
> for now.
> +    ASSERT_EFI_ERROR (Status);
> +  }
> +
> +  if (EFI_ERROR (Status)) {
> +    NvStorageVariableBase = NV_STORAGE_VARIABLE_BASE;
> +    NvStorageVariableSize = PcdGet32 (PcdFlashNvStorageVariableSize);
> +  }
> +
> +  ASSERT (NvStorageVariableBase != 0);
> +  VariableStoreBase = NvStorageVariableBase + mNvFvHeaderCache-
> >HeaderLength;


It seems to me that the above line is not needed. Already done in existing code several lines below.

Best Regards,
Hao Wu


> +
>    Status = FtwProtocol->GetMaxBlockSize (FtwProtocol, &FtwMaxBlockSize);
>    if (!EFI_ERROR (Status)) {
> -    ASSERT (PcdGet32 (PcdFlashNvStorageVariableSize) <= FtwMaxBlockSize);
> +    ASSERT (NvStorageVariableSize <= FtwMaxBlockSize);
>    }
> 
>    NvStorageVariableBase = NV_STORAGE_VARIABLE_BASE;
> diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.h
> b/MdeModulePkg/Universal/Variable/Pei/Variable.h
> index 7f9ad5bfc357..b2ba30b841c1 100644
> --- a/MdeModulePkg/Universal/Variable/Pei/Variable.h
> +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.h
> @@ -20,7 +20,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Library/BaseMemoryLib.h>
>  #include <Library/PeiServicesTablePointerLib.h>
>  #include <Library/PeiServicesLib.h>
> +#include <Library/SafeIntLib.h>
> 
> +#include <Guid/VariableFlashInfo.h>
>  #include <Guid/VariableFormat.h>
>  #include <Guid/VariableIndexTable.h>
>  #include <Guid/SystemNvDataGuid.h>
> diff --git a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> index 7cbdd2385e8f..2557219f9b30 100644
> --- a/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> +++ b/MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> @@ -39,6 +39,7 @@ [LibraryClasses]
>    DebugLib
>    PeiServicesTablePointerLib
>    PeiServicesLib
> +  SafeIntLib
> 
>  [Guids]
>    ## CONSUMES             ## GUID # Variable store header
> @@ -54,14 +55,15 @@ [Guids]
>    ## SOMETIMES_CONSUMES   ## HOB
>    ## CONSUMES             ## GUID # Dependence
>    gEdkiiFaultTolerantWriteGuid
> +  gVariableFlashInfoHobGuid   ## CONSUMES   ## HOB
> 
>  [Ppis]
>    gEfiPeiReadOnlyVariable2PpiGuid   ## PRODUCES
> 
>  [Pcd]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase      ##
> SOMETIMES_CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64    ##
> CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64    ##
> SOMETIMES_CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable         ##
> SOMETIMES_CONSUMES
> 
>  [Depex]
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> index 31e408976a35..c9bbd1568567 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> @@ -31,12 +31,14 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Library/MemoryAllocationLib.h>
>  #include <Library/AuthVariableLib.h>
>  #include <Library/VarCheckLib.h>
> +#include <Library/SafeIntLib.h>
>  #include <Guid/GlobalVariable.h>
>  #include <Guid/EventGroup.h>
>  #include <Guid/VariableFormat.h>
>  #include <Guid/SystemNvDataGuid.h>
>  #include <Guid/FaultTolerantWrite.h>
>  #include <Guid/VarErrorFlag.h>
> +#include <Guid/VariableFlashInfo.h>
> 
>  #include "PrivilegePolymorphic.h"
> 
> @@ -126,6 +128,21 @@ typedef struct {
>    EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *FvbInstance;
>  } VARIABLE_MODULE_GLOBAL;
> 
> +/**
> +  Get the HOB that contains variable flash information.
> +
> +  @param[out] VariableFlashInfo   Pointer to a pointer to set to the variable
> flash information structure.
> +
> +  @retval EFI_SUCCESS             Variable flash information was found successfully.
> +  @retval EFI_INVALID_PARAMETER   The VariableFlashInfo pointer given is
> NULL.
> +  @retval EFI_NOT_FOUND           Variable flash information could not be found.
> +
> +**/
> +EFI_STATUS
> +GetVariableFlashInfo (
> +  OUT VARIABLE_FLASH_INFO  **VariableFlashInfo
> +  );
> +
>  /**
>    Flush the HOB variable to flash.
> 
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> index c9434df631ee..6df350afa260 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> @@ -73,6 +73,7 @@ [LibraryClasses]
>    VarCheckLib
>    VariablePolicyLib
>    VariablePolicyHelperLib
> +  SafeIntLib
> 
>  [Protocols]
>    gEfiFirmwareVolumeBlockProtocolGuid           ## CONSUMES
> @@ -114,6 +115,7 @@ [Guids]
>    gEfiSystemNvDataFvGuid                        ## CONSUMES             ## GUID
>    gEfiEndOfDxeEventGroupGuid                    ## CONSUMES             ## Event
>    gEdkiiFaultTolerantWriteGuid                  ## SOMETIMES_CONSUMES   ## HOB
> +  gVariableFlashInfoHobGuid                     ## CONSUMES             ## HOB
> 
>    ## SOMETIMES_CONSUMES   ## Variable:L"VarErrorFlag"
>    ## SOMETIMES_PRODUCES   ## Variable:L"VarErrorFlag"
> @@ -125,9 +127,9 @@ [Guids]
>    gEfiImageSecurityDatabaseGuid
> 
>  [Pcd]
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase      ##
> SOMETIMES_CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64    ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64    ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize                 ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize             ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize         ##
> CONSUMES
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> index eaa97a01c6e5..398e7d9060ab 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> @@ -82,6 +82,7 @@ [LibraryClasses]
>    UefiBootServicesTableLib
>    VariablePolicyLib
>    VariablePolicyHelperLib
> +  SafeIntLib
> 
>  [Protocols]
>    gEfiSmmFirmwareVolumeBlockProtocolGuid        ## CONSUMES
> @@ -121,15 +122,16 @@ [Guids]
>    gSmmVariableWriteGuid                         ## PRODUCES             ## GUID # Install
> protocol
>    gEfiSystemNvDataFvGuid                        ## CONSUMES             ## GUID
>    gEdkiiFaultTolerantWriteGuid                  ## SOMETIMES_CONSUMES   ## HOB
> +  gVariableFlashInfoHobGuid                     ## CONSUMES             ## HOB
> 
>    ## SOMETIMES_CONSUMES   ## Variable:L"VarErrorFlag"
>    ## SOMETIMES_PRODUCES   ## Variable:L"VarErrorFlag"
>    gEdkiiVarErrorFlagGuid
> 
>  [Pcd]
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize       ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize       ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase       ##
> SOMETIMES_CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64     ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64     ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize                  ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize              ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize          ##
> CONSUMES
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> index d8c4f77e7f1f..efc9290ae759 100644
> ---
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> +++
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> @@ -73,6 +73,7 @@ [LibraryClasses]
>    HobLib
>    MemoryAllocationLib
>    MmServicesTableLib
> +  SafeIntLib
>    StandaloneMmDriverEntryPoint
>    SynchronizationLib
>    VarCheckLib
> @@ -114,6 +115,7 @@ [Guids]
> 
>    gEfiSystemNvDataFvGuid                        ## CONSUMES             ## GUID
>    gEdkiiFaultTolerantWriteGuid                  ## SOMETIMES_CONSUMES   ## HOB
> +  gVariableFlashInfoHobGuid                     ## CONSUMES             ## HOB
> 
>    ## SOMETIMES_CONSUMES   ## Variable:L"VarErrorFlag"
>    ## SOMETIMES_PRODUCES   ## Variable:L"VarErrorFlag"
> @@ -121,8 +123,8 @@ [Guids]
> 
>  [Pcd]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase       ##
> SOMETIMES_CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64     ##
> CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize       ##
> CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64     ##
> SOMETIMES_CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize       ##
> SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize                  ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize              ##
> CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize          ##
> CONSUMES
> --
> 2.28.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#88463): https://edk2.groups.io/g/devel/message/88463
> Mute This Topic: https://groups.io/mt/90293666/1768737
> Group Owner: devel+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [hao.a.wu at intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88502): https://edk2.groups.io/g/devel/message/88502
Mute This Topic: https://groups.io/mt/90293666/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