qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: "Xu, Min M" <min.m.xu@intel.com>,
	Dionna Amalie Glaze <dionnaglaze@google.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	"Yamahata, Isaku" <isaku.yamahata@intel.com>
Subject: Re: New "IndustryStandard" fw_cfg?
Date: Thu, 16 Jun 2022 14:33:28 +0800	[thread overview]
Message-ID: <a89cb720-3600-51ad-2671-ea0f987cd3d1@intel.com> (raw)
In-Reply-To: <PH0PR11MB50643B5AEE5A399EB8AFB000C5AD9@PH0PR11MB5064.namprd11.prod.outlook.com>

On 6/15/2022 8:46 AM, Xu, Min M wrote:
> I would like to add more engineers (Confidential Computing Reviewers in EDK2 community and Intel's QEMU engineers) in this mail thread.
> 
>> -----Original Message-----
>> From: Dionna Amalie Glaze <dionnaglaze@google.com>
>> Sent: Wednesday, June 15, 2022 2:09 AM
>> To: qemu-devel@nongnu.org
>> Cc: Xu, Min M <min.m.xu@intel.com>; Lendacky, Thomas
>> <Thomas.Lendacky@amd.com>
>> Subject: New "IndustryStandard" fw_cfg?
>>
>> Hi y'all, I'm Dionna. I work on Confidential VMs at Google Cloud. I've been
>> keeping up with the TDX and SEV-SNP developments in OVMF and Linux,
>> and some in Qemu.
>>
>> There's a new UEFI feature in v2.9 of the specification (March 2021) that
>> allows for memory ranges to be classified as "unaccepted", since both TDX
>> and SEV-SNP require that the guest VM accept any host-made changes to
>> page state. We should expect newer technologies on non-x86 architectures
>> to require memory acceptance as well. Operating systems are not
>> necessarily going to support this memory type, however.
>>
>> This leads to a problem: how does the UEFI know that the OS it's going to
>> boot will support unaccepted memory? 

After re-read and re-think, I think the problem is better to state as: 
we need an interface for QEMU to tell OVMF how much memory it needs to 
accept, from [Minimum to All]. So for the case that user wants to boot 
an partial-enabled confidential VMs (like current Linux TDX and SNP 
guest), user needs to specify from QEMU to tell OVMF to accept all the 
memory.

> Right now we (Google Compute
>> Engine) have a system of "tagging" for guest image providers to state that
>> their OS supports some new feature so that we can enable appropriate
>> configurations for certain images.
>>
>> I could go about adding a Google-specific fw_cfg file path and definition to
>> tell our custom OVMF build to use unaccepted memory or not, but I
>> personally prefer open source. I don't know y'all's process though, so I'm
>> asking before making a patch set.
>>
>> There are two approaches I've considered.
>>
>> 1. An arch-specific config key for a u64 value:
>>
>> The idea would be that I would add QemuFwCfgItemUnacceptedMinimum =
>> 0x8005 here
>> https://github.com/tianocore/edk2/blob/master/OvmfPkg/Include/Industry
>> Standard/QemuFwCfg.h#L50
>>
>> For Qemu, the main code I see for adding config is here, but I'm not sure
>> what y'all's preferred external configuration method is to get a value from an
>> invocation (flag, config file, etc) to fw_cfg.c:
>> https://github.com/qemu/qemu/blob/58b53669e87fed0d70903e05cd42079
>> fbbdbc195/hw/i386/fw_cfg.c#L95
>>
>> We'd add something like
>>
>> fw_cfg_add_u64(fw_cfg, FW_CFG_MINIMUM_ACCEPTED_MEMORY_SIZE,
>> ms->minimum_accepted_memory_size);
>>
>> where FW_CFG_MINIMUM_ACCEPTED_MEMORY_SIZE is #defined as
>> FW_CFG_ARCH_LOCAL + 5 in
>> https://github.com/qemu/qemu/blob/266469947161aa10b1d36843580d36
>> 9d5aa38589/hw/i386/fw_cfg.h
>>
>> The name has "minimum" in it since the firmware can choose to accept
>> more than the minimum, and specifically interpret 0 as UINT64_MAX.
>>
>> 2. A "well-known" file path to be included in the file slots starting at 0x0020,
>> such as "etc/min_accepted_mem_size", still plumbed through like in 1.
>>
>> Thanks!
>>
>> --
>> -Dionna Glaze, PhD (she/her)



  parent reply	other threads:[~2022-06-16  6:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 18:08 New "IndustryStandard" fw_cfg? Dionna Amalie Glaze
     [not found] ` <PH0PR11MB50643B5AEE5A399EB8AFB000C5AD9@PH0PR11MB5064.namprd11.prod.outlook.com>
2022-06-15  7:33   ` Gerd Hoffmann
2022-06-15 19:23     ` Dionna Amalie Glaze
2022-06-15 15:19   ` Xiaoyao Li
2022-06-15 16:51     ` Tom Lendacky
2022-06-16  5:37     ` Gerd Hoffmann
2022-06-16  5:49       ` Xiaoyao Li
2022-06-16  6:00         ` Gerd Hoffmann
2022-06-16  6:33   ` Xiaoyao Li [this message]
2022-06-16  8:28     ` Gerd Hoffmann
2022-06-17  2:53       ` Xiaoyao Li
2022-06-17 19:57         ` Dionna Amalie Glaze
2022-06-20 10:42           ` 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-all 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=a89cb720-3600-51ad-2671-ea0f987cd3d1@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=dionnaglaze@google.com \
    --cc=erdemaktas@google.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jiewen.yao@intel.com \
    --cc=kraxel@redhat.com \
    --cc=min.m.xu@intel.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).