From: Dov Murik <firstname.lastname@example.org>
Cc: "Tom Lendacky" <email@example.com>,
"Ashish Kalra" <firstname.lastname@example.org>,
"Brijesh Singh" <email@example.com>,
"Eduardo Habkost" <firstname.lastname@example.org>,
"Michael S. Tsirkin" <email@example.com>,
"Connor Kuehl" <firstname.lastname@example.org>,
"Laszlo Ersek" <email@example.com>,
"James Bottomley" <firstname.lastname@example.org>,
"Richard Henderson" <email@example.com>,
"Dr. David Alan Gilbert" <firstname.lastname@example.org>,
"Dov Murik" <email@example.com>,
"Tobin Feldman-Fitzthum" <firstname.lastname@example.org>,
"Jim Cadden" <email@example.com>,
"Paolo Bonzini" <firstname.lastname@example.org>,
"Philippe Mathieu-Daudé" <email@example.com>
Subject: [PATCH v3 0/2] x86/sev: Measured Linux SEV guest with kernel/initrd/cmdline
Date: Thu, 24 Jun 2021 10:20:38 +0000 [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
Currently booting with -kernel/-initrd/-append is not supported in SEV
confidential guests, because the content of these blobs is not measured
and therefore not trusted by the SEV guest.
However, in some cases the kernel, initrd, and cmdline are not secret
but should not be modified by the host. In such a case, we want to
verify inside the trusted VM that the kernel, initrd, and cmdline are
indeed the ones expected by the Guest Owner, and only if that is the
case go on and boot them up (removing the need for grub inside OVMF in
To support that, OVMF adds a special area for hashes of
kernel/initrd/cmdline; that area is expected to be filled by QEMU and
encrypted as part of the initial SEV guest launch. This in turn makes
the hashes part of the PSP measured content, and OVMF can trust these
inputs if they match the hashes.
This series adds an SEV function to generate the table of hashes for
OVMF and encrypt it (patch 1/2), and calls this function if SEV is
enabled when the kernel/initrd/cmdline are prepared (patch 2/2).
Corresponding OVMF support was submitted to edk2-devel  (patch series
"Measured SEV boot with kernel/initrd/cmdline"); it's still under
- initrd hash is now mandatory; if no -initrd is passed, calculate the
hash of the empty buffer. This is now aligned with the OVMF
behaviour which verifies the empty initrd (correctly).
- make SevHashTable entries fixed: 3 entries for cmdline, initrd, and kernel.
- in sev_add_kernel_loader_hashes: first calculate all the hashes, only then
fill-in the hashes table in the guest's memory.
- Use g_assert_not_reached in sev-stub.c.
- Use QEMU_PACKED attribute for structs.
- Use QemuUUID type for guids.
- in sev_add_kernel_loader_hashes: use ARRAY_SIZE(iov) instead of literal 2.
- Extract main functionality to sev.c (with empty stub in sev-stub.c)
- Use sev_enabled() instead of machine->cgs->ready to detect SEV guest
- Coding style changes
Dov Murik (2):
sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux
x86/sev: generate SEV kernel loader hashes in x86_load_linux
target/i386/sev_i386.h | 12 ++++
hw/i386/x86.c | 25 +++++++-
target/i386/sev-stub.c | 5 ++
target/i386/sev.c | 137 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 178 insertions(+), 1 deletion(-)
next reply other threads:[~2021-06-24 10:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-24 10:20 Dov Murik [this message]
2021-06-24 10:20 ` [PATCH v3 1/2] sev/i386: Introduce sev_add_kernel_loader_hashes for measured linux boot Dov Murik
2021-07-01 17:23 ` Connor Kuehl
2021-07-02 12:29 ` Dov Murik
2021-06-24 10:20 ` [PATCH v3 2/2] x86/sev: generate SEV kernel loader hashes in x86_load_linux Dov Murik
2021-07-08 16:41 ` [PATCH v3 0/2] x86/sev: Measured Linux SEV guest with kernel/initrd/cmdline Connor Kuehl
2021-07-08 17:03 ` Philippe Mathieu-Daudé
2021-07-08 17:16 ` Connor Kuehl
2021-07-29 19:31 ` Dov Murik
2021-07-30 14:47 ` Connor Kuehl
2021-07-30 18:02 ` Dov Murik
2021-07-30 18:14 ` Connor Kuehl
2021-07-09 6:55 ` Michael S. Tsirkin
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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).