public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Min Xu" <min.m.xu@intel.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH 3/3] OvmfPkg: Initialize NvVarStore with Configuration FV in Td guest
Date: Thu, 23 Jun 2022 00:40:03 +0000	[thread overview]
Message-ID: <PH0PR11MB5064EA95BAAD6A3D694492A1C5B59@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220622092233.qnalik3mu4uishmh@sirius.home.kraxel.org>

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

  reply	other threads:[~2022-06-23  0:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18  2:32 [PATCH 0/3] Enable Secure-Boot in Tdx guest Min Xu
2022-06-18  2:32 ` [PATCH 1/3] OvmfPkg: Move TdxValidateCfv from PeilessStartupLib to PlatformInitLib Min Xu
2022-06-18  2:32 ` [PATCH 2/3] OvmfPkg: Validate Cfv integrity in Tdx guest Min Xu
2022-06-18  2:32 ` [PATCH 3/3] OvmfPkg: Initialize NvVarStore with Configuration FV in Td guest Min Xu
2022-06-20 11:01   ` Gerd Hoffmann
2022-06-22  2:02     ` Min Xu
2022-06-22  7:01       ` Gerd Hoffmann
2022-06-22  8:14         ` Min Xu
2022-06-22  9:22           ` Gerd Hoffmann
2022-06-23  0:40             ` Min Xu [this message]
2022-06-23  7:23               ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR11MB5064EA95BAAD6A3D694492A1C5B59@PH0PR11MB5064.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox