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>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	"Chang, Abner" <abner.chang@hpe.com>,
	"Schaefer, Daniel" <daniel.schaefer@hpe.com>,
	"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 V3 0/7] Enable secure-boot when lauch OVMF with -bios parameter
Date: Thu, 30 Jun 2022 22:56:19 +0000	[thread overview]
Message-ID: <PH0PR11MB5064955F224DE06E0C6F51ACC5BA9@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220630132823.soam44jmopahv63y@sirius.home.kraxel.org>

On June 30, 2022 9:28 PM, Gerd Hoffmann wrote:
> On Wed, Jun 29, 2022 at 04:56:56PM +0800, Min Xu wrote:
> > Secure-Boot related variables include the PK/KEK/DB/DBX and they are
> > stored in NvVarStore (OVMF_VARS.fd). When lauching with -pflash,
> > QEMU/OVMF will use emulated flash, and fully support UEFI variables.
> > But when launching with -bios parameter, UEFI variables will be
> > partially emulated, and non-volatile variables may lose their contents
> > after a reboot. See OvmfPkg/README.
> >
> > Tdx guest is an example that -pflash is not supported. So this
> > patch-set is designed to initialize the NvVarStore with the content of
> > in OVMF_VARS.fd.
> >
> > patch 1:
> >  Add a new function (AllocateRuntimePages) in PrePiMemoryAllocationLib.
> >  This function will be used in PeilessStartupLib which will run  in
> > SEC phase.
> >
> > patch 2:
> >  Delete the TdxValidateCfv in PeilessStartupLib. Because it is going
> > to  be renamed to PlatformValidateNvVarStore and be moved to
> PlatformInitLib.
> >
> > patch 3 - 7:
> >  Then we add functions for EmuVariableNvStore in PlatformInitLib. This
> > lib will then be called in OvmfPkg/PlatformPei and PeilessStartupLib.
> >  We also shortcut ConnectNvVarsToFileSystem in secure-boot.
> >
> > patch 8:
> >  At last a build-flag (SECURE_BOOT_FEATURE_ENABLED) is introduced in
> > the dsc in OvmfPkg. Because the copy over of OVMR_VARS.fd to
> > EmuVariableNvStore is only required when secure-boot is enabled.
> >
> > Code: https://github.com/mxu9/edk2/tree/secure-boot.v3
> 
> /usr/bin/ld:
> /home/kraxel/projects/edk2/Build/IntelTdx/DEBUG_GCC5/X64/UefiCpuPkg/
> Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib/OUTPUT/S
> ecPeiCpuExceptionHandlerLib.lib(ExceptionHandlerAsm.obj): warning:
> relocation in read-only section `.text'
> /usr/bin/ld: /tmp/ccCEPSuH.ltrans0.ltrans.o: in function
> `SecCoreStartupWithStack':
> /home/kraxel/projects/edk2/OvmfPkg/Library/PlatformInitLib/Platform.c:76
> 0: undefined reference to `AllocateRuntimePages'
> /usr/bin/ld:
> /tmp/ccCEPSuH.ltrans0.ltrans.o:/home/kraxel/projects/edk2/OvmfPkg/Libra
> ry/PlatformInitLib/Platform.c:760: undefined reference to
> `AllocateRuntimePages'
> /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
> collect2: error: ld returned 1 exit status
> make: *** [GNUmakefile:431:
> /home/kraxel/projects/edk2/Build/IntelTdx/DEBUG_GCC5/X64/OvmfPkg/Int
> elTdx/Sec/SecMain/DEBUG/SecMain.dll] Error 1
> 
Ah  my bad. I forgot sending below patch in the series.
fec80e84db 2022-06-22 EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib [Min M Xu]
It is in https://github.com/mxu9/edk2/tree/secure-boot.v3
I will send a new version with this patch soon.

> adding a build test for intel tdx to ci is probably a good idea ...
I have submit  such build test and it has been acked-by. But it hasn't been merged. I will ask Jiewen to merge it.
https://edk2.groups.io/g/devel/message/89803

Thanks
Min

      reply	other threads:[~2022-06-30 22:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  8:56 [PATCH V3 0/7] Enable secure-boot when lauch OVMF with -bios parameter Min Xu
2022-06-29  8:56 ` [PATCH V3 1/7] OvmfPkg/PeilessStartupLib: Delete TdxValidateCfv Min Xu
2022-06-29  8:56 ` [PATCH V3 2/7] OvmfPkg/PlatformInitLib: Add functions for EmuVariableNvStore Min Xu
2022-06-29  8:56 ` [PATCH V3 3/7] OvmfPkg/PlatformPei: Update ReserveEmuVariableNvStore Min Xu
2022-06-29  8:57 ` [PATCH V3 4/7] OvmfPkg: Reserve and init EmuVariableNvStore in Pei-less Startup Min Xu
2022-06-29  8:57 ` [PATCH V3 5/7] OvmfPkg/NvVarsFileLib: Shortcut ConnectNvVarsToFileSystem in secure-boot Min Xu
2022-06-29  8:57 ` [PATCH V3 6/7] OvmfPkg/TdxDxe: Set PcdEmuVariableNvStoreReserved Min Xu
2022-06-29  8:57 ` [PATCH V3 7/7] OvmfPkg: Add build-flag SECURE_BOOT_FEATURE_ENABLED Min Xu
2022-06-30 13:28 ` [PATCH V3 0/7] Enable secure-boot when lauch OVMF with -bios parameter Gerd Hoffmann
2022-06-30 22:56   ` Min Xu [this message]

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=PH0PR11MB5064955F224DE06E0C6F51ACC5BA9@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