From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Xu, Min M" <min.m.xu@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>,
"brijesh.singh@amd.com" <brijesh.singh@amd.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
"Justen, Jordan L" <jordan.l.justen@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
"Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector
Date: Sat, 25 Sep 2021 23:30:02 +0000 [thread overview]
Message-ID: <PH0PR11MB488522396553E28A1ACAD7818CA59@PH0PR11MB4885.namprd11.prod.outlook.com> (raw)
In-Reply-To: <PH0PR11MB50646DC3E2B999AD88588E37C5A59@PH0PR11MB5064.namprd11.prod.outlook.com>
I recommend we start with 2 metadata and check in.
It is working today for both SEV and TDX, with KVM and Cloud Hypervisor support.
Thank you
Yao Jiewen
> -----Original Message-----
> From: Xu, Min M <min.m.xu@intel.com>
> Sent: Sunday, September 26, 2021 7:17 AM
> To: devel@edk2.groups.io; brijesh.singh@amd.com
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>; Justen, Jordan L
> <jordan.l.justen@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Erdem
> Aktas <erdemaktas@google.com>; James Bottomley <jejb@linux.ibm.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Tom Lendacky
> <thomas.lendacky@amd.com>
> Subject: RE: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector
>
> On September 25, 2021 11:21 AM, Brijesh Singh wrote:
> > Hi Min,
> >
> >
> > On 9/24/21 7:03 PM, Xu, Min M wrote:
> > > On September 24, 2021 6:58 PM, Brijesh Singh wrote:
> > >> Hi Min,
> > >>
> > >> On 9/21/21 4:05 AM, Min Xu wrote:
> > >>> ;
> > >>> ; Modified: EAX, EBX, ECX, EDX
> > >>> ;
> > >>> SetCr3ForPageTables64:
> > >>> -
> > >>> - ; Clear the WorkArea header. The SEV probe routines will populate the
> > >>> - ; work area when detected.
> > >>> - mov byte[WORK_AREA_GUEST_TYPE], 0
> > >> Why you are removing the above block ? The workarea hdr must be
> > >> initialized to zero, its not safe to assume that the guest memory is
> > >> zero'ed in the non- encrypted case.
> > >>
> > > Hi, Brijesh
> > > Please see below explanation (It is in the commit message)
> > > - In Main16 entry point, after TransitionFromReal16To32BitFlat,
> > > WORK_AREA_GUEST_TYPE is cleared to 0. WORK_AREA_GUEST_TYPE was
> > > previously cleared in SetCr3ForPageTables64 (see commit ab77b60).
> > > This doesn't work after TDX is introduced in Ovmf. It is because all
> > > TDX CPUs (BSP and APs) start to run from 0xfffffff0. In previous code
> > > WORK_AREA_GUEST_TYPE will be cleared multi-times in TDX guest. So for
> > > SEV and Legacy guest it is moved to Main16 entry point (after
> > > TransitionFromReal16To32BitFlat). For TDX guest
> > WORK_AREA_GUEST_TYPE
> > > is cleared and set in InitTdxWorkarea
> >
> > thanks for clarifying it.
> >
> > This is very busy commit and making several changes at once, so some of
> > important common code movement is getting lost. Maybe I recommend you
> to
> > please break it into multiple. e,g this particular change can be very easily
> broken
> > into two commits
> >
> > 1) Since TDX support need the change in the boot flow, and you are no longer
> > using the Main.asm from the UefiCpuPkg. This can be a pre-patch in which you
> > copy UefiCpuPkg/ResetVector/Vtf0/main.asm ->
> > OvmfPkg/ResetVector/Main.asm and document reason behind the move.
> >
> > 2) Remove clearing of workarea from SetCr3ForPageTables64 to Main.asm
> >
> > Now that we have override for the Main.asm, I think clearing of the workarea
> > should be done for all architecture (Ia32, x64) to cover the cases where
> > someone builds the OVMF for 32bit or IA32 and X64.
> >
> Thanks for reminder. I have updated the patch-set as you mentioned. But I am
> waiting for a conclusion of the Metadata, a unified metadata or two separate
> metadata.
>
> Hoffmann and Jiewen
> Do we have a conclusion?
>
> Thanks
> Min
next prev parent reply other threads:[~2021-09-25 23:30 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-21 9:05 [PATCH V7 0/1] Add Intel TDX support in OvmfPkg/ResetVector Min Xu
2021-09-21 9:05 ` [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector Min Xu
2021-09-22 7:49 ` Gerd Hoffmann
2021-09-23 0:38 ` Min Xu
2021-09-23 8:48 ` Gerd Hoffmann
2021-09-23 11:39 ` Yao, Jiewen
2021-09-23 12:54 ` Brijesh Singh
2021-09-23 13:18 ` Yao, Jiewen
2021-09-23 13:19 ` [edk2-devel] " Min Xu
2021-09-23 13:38 ` Yao, Jiewen
2021-09-23 14:03 ` Brijesh Singh
2021-09-23 14:15 ` Min Xu
2021-09-23 14:19 ` Yao, Jiewen
2021-09-24 5:37 ` Gerd Hoffmann
2021-09-24 7:36 ` Yao, Jiewen
2021-09-24 9:24 ` Gerd Hoffmann
2021-09-24 9:55 ` Yao, Jiewen
2021-09-24 5:28 ` Gerd Hoffmann
2021-09-24 6:55 ` Min Xu
2021-09-24 10:07 ` Gerd Hoffmann
2021-09-24 10:33 ` Yao, Jiewen
2021-09-24 14:02 ` Gerd Hoffmann
2021-09-24 16:40 ` Yao, Jiewen
2021-09-27 8:05 ` Gerd Hoffmann
2021-09-27 10:05 ` Yao, Jiewen
2021-09-27 14:59 ` Gerd Hoffmann
2021-09-28 0:21 ` Yao, Jiewen
2021-09-24 7:32 ` Yao, Jiewen
2021-09-24 9:15 ` Gerd Hoffmann
2021-09-24 4:54 ` Gerd Hoffmann
2021-09-24 7:39 ` Yao, Jiewen
2021-09-24 9:34 ` Gerd Hoffmann
2021-09-24 10:11 ` Yao, Jiewen
2021-09-24 10:38 ` Brijesh Singh
2021-09-24 11:17 ` Gerd Hoffmann
2021-09-24 11:29 ` Brijesh Singh
2021-09-24 10:14 ` Brijesh Singh
2021-09-24 10:58 ` Brijesh Singh
2021-09-25 0:03 ` Min Xu
2021-09-25 3:21 ` Brijesh Singh
2021-09-25 23:17 ` [edk2-devel] " Min Xu
2021-09-25 23:30 ` Yao, Jiewen [this message]
2021-09-27 8:44 ` 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=PH0PR11MB488522396553E28A1ACAD7818CA59@PH0PR11MB4885.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