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>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	"Justen, Jordan L" <jordan.l.justen@intel.com>,
	Brijesh Singh <brijesh.singh@amd.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: [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector
Date: Thu, 23 Sep 2021 00:38:24 +0000	[thread overview]
Message-ID: <PH0PR11MB5064F97181FD6AE9F5BEA7F6C5A39@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210922074929.e5iwf24t6wyndgbu@sirius.home.kraxel.org>

On September 22, 2021 3:49 PM, Gerd Hoffmann wrote:
>   Hi,
> 
> > +%ifdef ARCH_X64
> > +;
> > +; TDX Metadata offset block
> > +;
> > +; TdxMetadata.asm is included in ARCH_X64 because Inte TDX is only ;
> > +available in ARCH_X64. Below block describes the offset of ;
> > +TdxMetadata block in Ovmf image ; ; GUID :
> > +e47a6535-984a-4798-865e-4685a7bf8ec2
> > +;
> > +tdxMetadataOffsetStart:
> > +    DD      tdxMetadataOffsetStart - TdxMetadataGuid - 16
> > +    DW      tdxMetadataOffsetEnd - tdxMetadataOffsetStart
> > +    DB      0x35, 0x65, 0x7a, 0xe4, 0x4a, 0x98, 0x98, 0x47
> > +    DB      0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2
> > +tdxMetadataOffsetEnd:
> > +
> > +%endif
> 
> This should be switched to common ovmf metadata (see patches 4-7 of the
> SEV-SNP series).
> 
> Min: please have a look at these patches.
>
Hi, Gerd
I checked the patches 4-7 of the SEV-SNP series. The common OvmfMetadata is designed for both SEV and TDX, right? 
If so, then it means the SEV and TDX metadata will be mixed in this OvmfMetadata. I am thinking there will always be different fields for SEV and TDX. For example, SEV has PcdOvmfSecGhcbPageTable but TDX doesn't need that page. If the common OvmfMetadata is consumed by TDX-QEMU, then PcdOvmfSecGhcbPageTableBase will be initialized too. That doesn't make sense.
I am thinking that SEV and TDX can keep their own Metadata (in separate files, SevMetadata.asm and TdxMetadata.asm) which are pointed by the SEV or TDX offsets in the GUID-ed chain in ResetVector. In this case, SEV and TDX can design their own metadata flexibly, for example, the attribute, the item structure, add/remove/update the items, etc. And it will be more friendly to the reviewer for the Metadata, at least from the name of the items.
> 
> Brijesh: It might be useful to post the metadata patches as separate series.
> 
> > +; Load the GDT and set the CR0, then jump to Flat 32 protected mode.
> 
> That comment isn't correct, you are already in 32-bit mode.
Thanks. It will be updated in the next version.
> 
> > +; Modified:  EAX, EBX, CR0, CR4, DS, ES, FS, GS, SS
> 
> CS too ...
It will be fixed in the next version.
> 
> > +    jmp     LINEAR_CODE_SEL:dword
> ADDR_OF(jumpToFlat32BitAndLandHere)
> > +jumpToFlat32BitAndLandHere:
> 
> ... right here.
> 
> > --- /dev/null
> > +++ b/OvmfPkg/ResetVector/Main.asm
> 
> Can you add a separate patch for "copy Main.asm from UefiCpuPkg
> unmodified" please?  Having the changes for TDX separately is helpful for
> review.
Sure. It will be separated in the next version.
> 

Thanks!
Min

  reply	other threads:[~2021-09-23  0:38 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 [this message]
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
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=PH0PR11MB5064F97181FD6AE9F5BEA7F6C5A39@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