qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New "IndustryStandard" fw_cfg?


From: Xiaoyao Li
Subject: Re: New "IndustryStandard" fw_cfg?
Date: Fri, 17 Jun 2022 10:53:46 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.10.0

On 6/16/2022 4:28 PM, Gerd Hoffmann wrote:
   Hi,

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.

Asking the user to manually configure stuff sucks, that's why I think
it makes sense to let firmware and guest negotiate this automatically.

That doesn't work today though, so we will need some config option
indeed.

The proposal in the parallel thread is to just accept all low memory
(below 4G) unconditionally.  So maybe it is enough to have:

   * accept all memory below 4G
   * accept all memory

Possibly we need:

   * accept all memory below 4G
   * accept all memory below 4G, plus x GB of high memory.
   * accept all memory

In any case the config option should be designed in a way that we can
add a 'automatic' choice later, i.e. we can have ...

   * automatic (default)
   * accept all memory below 4G
   * accept all memory

... once the automatic negotiation is available.

IMO, basically, we need two options:

1. accept all memory, for the case that guest OS cannot handle unaccepted memory;

2. accept minimal memory, for the case that guest OS is capable of
accepting memory.

   Accepting memory is time consuming. To save as much time as possible,
   OVMF only needs to accept:

   a. the enough memory for its own code running;

   b. the enough memory for guest OS to setup everything ready to accept
      memory on guest own. e.g.,

      i.  the memory where guest kernel locates;
      ii. the stack/heap/memory buffer, from which guest kernel needs
          to allocate memory

   As long as both a) and b) are meet, we can accept as less as possible
   to save the time OVMF is running.

   Min did some POC on this for TDX, that accepts 256M/128M (I don't
   remember the exact number) in OVMF for guest kernel to operate
   normally and guest can accept remaining unaccepted memory on its own.

More flexible, we can provide a 3) option, that guest tells OVMF the GPA ranges that need to be accepted by OVMF.

take care,
   Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]