public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Brijesh Singh" <brijesh.singh@amd.com>
To: Dov Murik <dovmurik@linux.ibm.com>, Gerd Hoffmann <kraxel@redhat.com>
Cc: brijesh.singh@amd.com, devel@edk2.groups.io,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Erdem Aktas <erdemaktas@google.com>,
	James Bottomley <jejb@linux.ibm.com>, Min Xu <min.m.xu@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Tobin Feldman-Fitzthum <tobin@linux.ibm.com>
Subject: Re: [PATCH 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation
Date: Wed, 30 Mar 2022 14:35:02 -0500	[thread overview]
Message-ID: <4fdbb522-e7e5-a0a8-ee1b-003e3f80c9c6@amd.com> (raw)
In-Reply-To: <5a8dfc50-d9e8-447e-6328-302d8a519c79@linux.ibm.com>



On 3/30/22 14:31, Dov Murik wrote:
> 
> 
> On 30/03/2022 22:27, Brijesh Singh wrote:
>>
>>
>> On 3/30/22 01:04, Dov Murik wrote:
>>>
>>>
>>> On 30/03/2022 8:20, Gerd Hoffmann wrote:
>>>>     Hi,
>>>>
>>>>> Check if that page is defined; if it is, skip it in the metadata list.
>>>>> In such case, VMM should fill the page with the hashes content, or
>>>>> explicitly update it as a zero page (if kernel hashes are not used).
>>>>
>>>> Is it an option to just skip the page unconditionally?
>>>>
>>>> I think in the OvmfPkgX64 build the page is not used, so it probably
>>>> doesn't matter whenever it is included or not, and it would make things
>>>> a bit less confusing ...
>>>>
>>>
>>>
>>> Brijesh,
>>>
>>> What would happen if we change this:
>>>
>>>       %define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)
>>>
>>> to:
>>>
>>>       %define SNP_SEC_MEM_BASE_DESC_3 (FixedPcdGet32
>>> (PcdOvmfSecPeiTempRamBase))
>>>
>>> in OvmfPkg/ResetVector/ResetVector.nasmb ?
>>>
>>> It means that the page starting at MEMFD_BASE_ADDRESS+0x00F000 (that
>>> is, the page
>>> that follows the SNP CPUID page) will not be pre-validated by QEMU.
>>>
>>
>> Lets look at the OvmfPkgX64.fdf is
>>
>> ...
>>
>> 0x00E000|0x001000
>> gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfCpuidSize
>>
>>
>> 0x010000|0x010000
>> gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize
>>
>>
>> 0x020000|0x0E0000
>> gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
>>
>>
>> ...
>>
>> If you change SNP_SEC_MEM_BASE_DESC_3 to start from PcdOvmfPeiMemFvBase
>> then who will validate the range for  PcdOvmfSecPeiTempRamBase -
>> PcdOvmfPeiMemFvBase ? The SEC phase (Sec/X64/SecEntry.nasm) uses the
>> PcdOvmfSecPeiTempRamBase. If the memory is not validated prior to use
>> then it will result in #VC (page-not-validated) and crash the guest BIOS
>> boot.
>>
> 
> Gerd actually wants to change SNP_SEC_MEM_BASE_DESC_3 to start from
> PcdOvmfSecPeiTempRamBase, which is 0x010000.
> 
> Supposedly no one uses the single page at 0x00F000 .

Yes, that should be alright as long as the SNP_SEC_MEM_BASE_DESC_3 start 
from PcdOvmfSecPeiTempRamBase. In PEI phase, we validate all the 
unvalidated range. So, as long as SEC phase is not using 800F000 - 
8010000 we should be good. The PEI will validate that page.

thanks


  reply	other threads:[~2022-03-30 19:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 18:45 [PATCH 0/2] OvmfPkg: Enable measured direct boot on AMD SEV-SNP Dov Murik
2022-03-28 18:45 ` [PATCH 1/2] OvmfPkg/AmdSev: Reorder MEMFD pages to match the order in OvmfPkgX64.fdf Dov Murik
2022-03-29 11:36   ` Gerd Hoffmann
2022-03-29 12:32     ` Dov Murik
2022-03-30  5:14       ` Gerd Hoffmann
2022-03-30  5:58         ` Dov Murik
2022-03-28 18:45 ` [PATCH 2/2] OvmfPkg/ResetVector: Exclude SEV launch secrets page from pre-validation Dov Murik
2022-03-30  5:20   ` Gerd Hoffmann
2022-03-30  6:04     ` Dov Murik
2022-03-30 19:27       ` Brijesh Singh
2022-03-30 19:31         ` Dov Murik
2022-03-30 19:35           ` Brijesh Singh [this message]
2022-03-30 20:35             ` Dov Murik
2022-03-31  7:49               ` 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=4fdbb522-e7e5-a0a8-ee1b-003e3f80c9c6@amd.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