> +  UINT8                 *CfvBase;
> +  UINT32                CfvSize;
>  
>    DEBUG ((DEBUG_INFO, "EMU Variable FVB Started\n"));
>  
> @@ -774,6 +776,23 @@ FvbInitialize (
>  
>    mEmuVarsFvb.BufferPtr = Ptr;
>  
> +  //
> +  // In Tdx guest the VarNvStore content should be initialized by the 
> Configuration FV (CFV).
> +  // Integrity of the CFV has been validated by TdxValidateCfv 
> (@PlatformInitLib)
> +  //
> +  if (TdIsEnabled ()) {
> +    CfvBase = (UINT8 *)(UINTN)PcdGet32 (PcdCfvBase);
> +    CfvSize = (UINT32)PcdGet32 (PcdCfvRawDataSize);
> +
> +    if (CfvSize > mEmuVarsFvb.Size) {
> +      DEBUG ((DEBUG_ERROR, "Size of CFV is larger than the EMU Variable 
> FVB.\n"));
> +      ASSERT (FALSE);
> +    } else {
> +      CopyMem (Ptr, CfvBase, CfvSize);
> +      Initialize = FALSE;
> +    }
> +  }

There is PcdEmuVariableNvStoreReserved for that.  How about just
copying the store to ram, then set PcdEmuVariableNvStoreReserved
to the location and let the existing logic handle it?

Also why limit this to tdx?

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90625): https://edk2.groups.io/g/devel/message/90625
Mute This Topic: https://groups.io/mt/91835110/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to