From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
"Alexander Graf" <graf@amazon.com>,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
"Eric Blake" <eblake@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
mimoja@mimoja.de
Subject: Re: [PATCH 00/16] hw/uefi: add uefi variable service
Date: Tue, 21 Nov 2023 16:08:08 +0000 [thread overview]
Message-ID: <ZVzV6Au_FYK6Rav6@redhat.com> (raw)
In-Reply-To: <7bfb52e6-3698-7c44-5927-31d47d031d57@redhat.com>
On Tue, Nov 21, 2023 at 04:58:44PM +0100, Laszlo Ersek wrote:
> On 11/20/23 17:50, Gerd Hoffmann wrote:
> > On Mon, Nov 20, 2023 at 12:53:45PM +0100, Alexander Graf wrote:
> >> Hey Gerd!
> >>
> >> On 15.11.23 16:12, Gerd Hoffmann wrote:
> >>> This patch adds a virtual device to qemu which the uefi firmware can use
> >>> to store variables. This moves the UEFI variable management from
> >>> privileged guest code (managing vars in pflash) to the host. Main
> >>> advantage is that the need to have privilege separation in the guest
> >>> goes away.
> >>>
> >>> On x86 privileged guest code runs in SMM. It's supported by kvm, but
> >>> not liked much by various stakeholders in cloud space due to the
> >>> complexity SMM emulation brings.
> >>>
> >>> On arm privileged guest code runs in el3 (aka secure world). This is
> >>> not supported by kvm, which is unlikely to change anytime soon given
> >>> that even el2 support (nested virt) is being worked on for years and is
> >>> not yet in mainline.
> >>>
> >>> The design idea is to reuse the request serialization protocol edk2 uses
> >>> for communication between SMM and non-SMM code, so large chunks of the
> >>> edk2 variable driver stack can be used unmodified. Only the driver
> >>> which traps into SMM mode must be replaced by a driver which talks to
> >>> qemu instead.
> >>
> >>
> >> I'm not sure I like the split :). If we cut things off at the SMM
> >> communication layer, we still have a lot of code inside the Runtime Services
> >> (RTS) code that is edk2 specific which means we're tying ourselves tightly
> >> to the edk2 data format.
> >
> > Which data format?
> >
> > Request serialization format? Yes. I can't see what is wrong with
> > that.
>
> ... I can't even see what's wrong with *that*. Realistically /
> practically, I think only edk2 has been considered as guest UEFI
> firmware for QEMU/KVM virtual machines, as far as upstream projects go.
> It's certainly edk2 that's bundled with QEMU.
>
> My understanding is that firmware is just considered a part of the
> virtualization platform, so teaching edk2 specifics to QEMU doesn't seem
> wrong. (As long as we have the personpower to maintain interoperability.)
>
> > We need one anyway, and I don't see why inventing a new one is
> > any better than the one we already have in edk2.
> >
> > Variable storage format? Nope, that is not the case. The variable
> > driver supports a cache, which I think is a read-only mapping of the
> > variable store, so using that might imply we have to use edk2 storage
> > format. Didn't check in detail through. The cache is optional, can be
> > disabled at compile time using PcdEnableVariableRuntimeCache=FALSE, and
> > I intentionally do not use the cache feature, exactly to avoid unwanted
> > constrains to the host side implementation.
> >
> >> It also means we can not easily expose UEFI
> >> variables that QEMU owns,
> >
> > Qemu owning variables should be no problem. Adding monitor commands to
> > read/write UEFI variables should be possible too.
>
> This patch set is actually an improvement towards QEMU-owned variables.
> Right now, all variables are internal to the guest; QEMU only has a
> pflash-level view.
To throw confidental computing into the mix....
Right now for SEV-SNP/TDX, the EDK2 builds are stateless so that
variables are thrown away at poweroff.
Long term though there's interest in having the ability to (optionally)
offer persistence of variables to confidential computing too.
The key issue is that the host QEMU is not trusted so it would not be
viable to let QEMU receive the variables in plain text.
One option I've illustrated before is that have SVSM (or equiv)
expose an encrypted storage service to EDK2. Given the proposed EDK2
side protocol/modifications for variable storage, I wonder if it is
viable for SVSM (or equiv) to replace QEMU in providing the backend
storage impl ? IOW, host QEMU would expose a pflash to the guest,
to which SVSM would apply full disk encryption, and then store the
EFI variables in it
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2023-11-21 16:09 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 15:12 [PATCH 00/16] hw/uefi: add uefi variable service Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 01/16] hw/uefi: add include/hw/uefi/var-service-api.h Gerd Hoffmann
2023-11-16 12:46 ` Laszlo Ersek
2023-11-15 15:12 ` [PATCH 02/16] hw/uefi: add include/hw/uefi/var-service-edk2.h Gerd Hoffmann
2023-11-16 15:23 ` Laszlo Ersek
2023-11-15 15:12 ` [PATCH 03/16] hw/uefi: add include/hw/uefi/var-service.h Gerd Hoffmann
2023-11-17 14:11 ` Laszlo Ersek
2023-11-22 15:12 ` Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 04/16] hw/uefi: add var-service-guid.c Gerd Hoffmann
2023-11-21 13:42 ` Laszlo Ersek
2023-11-15 15:12 ` [PATCH 05/16] hw/uefi: add var-service-core.c Gerd Hoffmann
2023-11-22 12:25 ` Laszlo Ersek
2023-11-22 16:30 ` Gerd Hoffmann
2023-12-08 12:53 ` Laszlo Ersek
2023-11-15 15:12 ` [PATCH 06/16] hw/uefi: add var-service-vars.c Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 07/16] hw/uefi: add var-service-auth.c Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 08/16] hw/uefi: add var-service-policy.c Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 09/16] hw/uefi: add support for storing persistent variables on disk Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 10/16] hw/uefi: add trace-events Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 11/16] hw/uefi: add to Kconfig Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 12/16] hw/uefi: add to meson Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 13/16] hw/uefi: add uefi-vars-sysbus device Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 14/16] hw/uefi: add uefi-vars-isa device Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 15/16] hw/arm: add uefi variable support to virt machine type Gerd Hoffmann
2023-11-15 15:12 ` [PATCH 16/16] docs: add uefi variable service documentation and TODO list Gerd Hoffmann
2023-11-15 15:56 ` Eric Blake
2023-11-20 11:53 ` [PATCH 00/16] hw/uefi: add uefi variable service Alexander Graf
2023-11-20 16:50 ` Gerd Hoffmann
2023-11-21 15:58 ` Laszlo Ersek
2023-11-21 16:08 ` Daniel P. Berrangé [this message]
2023-11-22 12:40 ` Gerd Hoffmann
2023-11-22 12:11 ` 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=ZVzV6Au_FYK6Rav6@redhat.com \
--to=berrange@redhat.com \
--cc=ardb@kernel.org \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=graf@amazon.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=mimoja@mimoja.de \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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).