On Wed, Jun 22, 2022 at 02:02:00AM +0000, Xu, Min M wrote: > On June 20, 2022 7:01 PM, Gerd Hoffman wrote: > > > > 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?
> There is ReserveEmuVariableNvStore in PlatformPei/Platform.c. This > function is called to allocate storage for NV Variables. > PcdEmuVariableNvStoreReserved is set in that function too. So we can > copy the content to that reserved storage if it is tdx guest. Then we > let the exiting logic to handle it. So I would like to extract > ReserveEmuVariableNvStore to PlatformReserveEmuVariableNvStore (in > PlatformInitLib) and call it in both PlatformPei/Platform.c and > PeilesssStartup.c. Moving the ReserveEmuVariableNvStore() function to PlatformInitLib make sense. Will be a bit more than pure code motion though, we probably need a new variable in the platforminfo struct because PeilesssStartup.c can't set PCDs. Copying over the content in PlatformInitLib makes sense too, probably best as separate function. > > Also why limit this to tdx? > Because I am not sure if other platforms need such operation. So in > current stage it is limit to tdx. I think the code should copy over the varstore in case the SECURE_BOOT_ENABLE option is set. That is the actual use case and it makes sense without TDX too. take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90671): https://edk2.groups.io/g/devel/message/90671 Mute This Topic: https://groups.io/mt/91835110/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
