public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: "Xu, Min M" <min.m.xu@intel.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: Wed, 22 Jun 2022 09:01:27 +0200	[thread overview]
Message-ID: <20220622070127.toheatopvja6lrhd@sirius.home.kraxel.org> (raw)
In-Reply-To: <PH0PR11MB506414BF55D3BF3AB07B362AC5B29@PH0PR11MB5064.namprd11.prod.outlook.com>

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


  reply	other threads:[~2022-06-22  7:01 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 [this message]
2022-06-22  8:14         ` Min Xu
2022-06-22  9:22           ` Gerd Hoffmann
2022-06-23  0:40             ` Min Xu
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=20220622070127.toheatopvja6lrhd@sirius.home.kraxel.org \
    --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