On June 22, 2022 5:23 PM, Gerd Hoffmann wrote: > > > Yes, PlatformReserveEmuVariableNvStore() will be a separated function > > and it returns the pointer of the allocated storage. Then this pointer > > can be set to either the PCD (PlatformPei) or in PlatformInfoHob > > (PeilessStartupLib). > > I mean copying over should be a separate function too, so it is up to the > caller not the library itself to decide whenever the copying should happen or > not. I see. I will do that. > > > > > > 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. > > Then we need add a build-flag in *.dsc. Do you think OvmfPkgX64.dsc and > IntelTdxX64.dsc are enough? > > The flag is already there ;) SECURE_BOOT_ENABLE is not a build-flag. It can only works in .dsc files. The build-flag(SECURE_BOOT_FEATURE_ENABLED) would be defined in .dsc: [BuildOptions] !if $(SECURE_BOOT_ENABLE) == TRUE MSFT:*_*_*_CC_FLAGS = /D SECURE_BOOT_FEATURE_ENABLED INTEL:*_*_*_CC_FLAGS = /D SECURE_BOOT_FEATURE_ENABLED GCC:*_*_*_CC_FLAGS = -D SECURE_BOOT_FEATURE_ENABLED !endif
Then it will be used like: #ifdef SECURE_BOOT_FEATURE_ENABLED CopyOverVarStoreContent() #endif In this way, there are totally 7 dsc in OvmfPkg need updated. - IntelTdx/IntelTdxX64.dsc - CloudHv/CloudHvX64.dsc - Bhyve/BhyveX64.dsc - Microvm/MicrovmX64.dsc - OvmfPkgIa32.dsc - OvmfPkgX64.dsc - OvmfPkgIa32X64.dsc Thanks Min -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90706): https://edk2.groups.io/g/devel/message/90706 Mute This Topic: https://groups.io/mt/91835110/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
