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>, "Yao, Jiewen" <jiewen.yao@intel.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>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	"Xu, Min M" <min.m.xu@intel.com>
Subject: Re: [PATCH V8 3/3] OvmfPkg: Enable TDX in ResetVector
Date: Tue, 28 Sep 2021 02:30:16 +0000	[thread overview]
Message-ID: <PH0PR11MB5064BEEAC041F4F7E43AEAE8C5A89@PH0PR11MB5064.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210927084235.pj7x2agzzzjqz7be@sirius.home.kraxel.org>

On September 27, 2021 4:43 PM, Gerd Hoffmann wrote:
>   Hi,
> 
> > +_Bfv:
> > +  DD TDX_BFV_RAW_DATA_OFFSET
> > +  DD TDX_BFV_RAW_DATA_SIZE
> > +  DQ TDX_BFV_MEMORY_BASE
> > +  DQ TDX_BFV_MEMORY_SIZE
> > +  DD TDX_METADATA_SECTION_TYPE_BFV
> > +  DD TDX_METADATA_ATTRIBUTES_EXTENDMR
> 
> Size is still added twice, doesn't make sense given that they are either equal
> or RAW_DATA_SIZE is zero.  One size field being 32bit and the other being
> 64bit is pointless too (see also my mail to Jiewen).
>
Gerd, I would like to hold on until Jiewen and you reach consensus. Thanks for your understanding.
> 
> > +  DD TDX_METADATA_SECTION_TYPE_TEMP_MEM
> 
> There are a bunch of TEMP_MEM entries, some of them are next to each
> other in MEMFD, so you can squash them into one entry.

Below is the layout of MEMFD (Used by TDX)
I will squash the TEMP_MEM entries into one entry if they're adjacent. For example,  Mailbox + WorkArea will be squash into one entry.
But the Heap/Stack cannot be squashed with Mailbox/Workarea, because there is a memory hole (0xD000 - 0x10000) between these 2 entry.

+------------------------------------------------+  0x20000
|                                                                 |
|      PcdOvmfSecPeiTempRam             | * Tdx Heap/Stack (Mem)*
|                                                                 |
+------------------------------------------------+ 0x10000
|                                                                 |
+------------------------------------------------+0xD000
|     PcdOvmfSecGhcbBackupBase       |  *Tdx Mailbox (Mem)*
+------------------------------------------------+0xC000
|    PcdOvmWorkArea                            |  *WorkArea (Mem)*
+------------------------------------------------+0xB000
|    PcdOvmfSecGhcb                              | *TdHob  (HOB)*
+------------------------------------------------+0x9000
|    PcdOvmfSecGhcbPageTable            |
|    PcdGuidedExtractHandlerTable      |
|    PcdOvmfLockBoxStorage                 |
+------------------------------------------------+ 0x6000
|                                                                 |
|    PcdOvmfSecPageTables                   |  *PageTables (Mem)*
|                                                                 | 
+------------------------------------------------+0x0000

> 
> Can you move the metadata changes to a separate patch please?
> 
Yes, the metadata changes will be in a separate patch in the next version.

Thanks!
Min

  reply	other threads:[~2021-09-28  2:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27  2:05 [PATCH V8 0/3] Add Intel TDX support in OvmfPkg/ResetVector Min Xu
2021-09-27  2:05 ` [PATCH V8 1/3] OvmfPkg: Copy Main.asm from UefiCpuPkg to OvmfPkg's ResetVector Min Xu
2021-09-27  2:05 ` [PATCH V8 2/3] OvmfPkg: Clear WORK_AREA_GUEST_TYPE in Main.asm Min Xu
2021-09-27  2:05 ` [PATCH V8 3/3] OvmfPkg: Enable TDX in ResetVector Min Xu
2021-09-27  8:42   ` Gerd Hoffmann
2021-09-28  2:30     ` Min Xu [this message]
2021-09-28  4:42       ` Gerd Hoffmann
2021-09-28  7:35         ` [edk2-devel] " Min Xu
2021-09-28 15:23           ` Brijesh Singh
2021-09-30  7:31             ` Min Xu
2021-09-30 17:39               ` Brijesh Singh
2021-10-08  1:13                 ` Yao, Jiewen

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