From: Roy Hopkins <roy.hopkins@suse.com>
To: qemu-devel@nongnu.org
Cc: "Roy Hopkins" <roy.hopkins@suse.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Sergio Lopez" <slp@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Alistair Francis" <alistair@alistair23.me>,
"Peter Xu" <peterx@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Tom Lendacky" <thomas.lendacky@amd.com>,
"Michael Roth" <michael.roth@amd.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Jörg Roedel" <jroedel@suse.com>
Subject: [PATCH v3 00/15] Introduce support for IGVM files
Date: Fri, 21 Jun 2024 15:29:03 +0100 [thread overview]
Message-ID: <cover.1718979106.git.roy.hopkins@suse.com> (raw)
Based-on: 02d9c38236
Here is v3 of the set of patches to add support for IGVM files to QEMU.
Firstly, apologies for the long gap between v2 and v3. This was due to a number
of factors, but particularly holding back until SEV-SNP support landed in QEMU
as well as for some changes to be merged in the upstream IGVM specification and
library. The delay meant that I could include the SEV-SNP IGVM changes that I
had been separately maintaining for COCONUT-SVSM into this series, giving full
support for the full range of SEV technologies.
Thank-you to everyone who reviewed the previous set of patches [1]. I
have hopefully addressed all of the comments in those reviews. Some of these
changes required a reasonable amount of rework. Along with the inclusion of
support for SEV-SNP, this has resulted in a fairly large set of differences from
v2. This v3 patch series is also available on github: [2]
For testing IGVM support in QEMU you need to generate an IGVM file that is
configured for the platform you want to launch. I have updated the `buildigvm`
test tool [3] to allow generation of IGVM files for all currently supported
platforms.
In my own testing I have launched guests using IGVM files for each supported
platform. In addition, I have verified that the launch measurement for SEV,
SEV-ES and SEV-SNP when using QEMU with IGVM matches the pre-calculated
measurement using the COCONUT-SVSM `igvmmeasure` tool [4]. This same tool
was used to sign the SEV-SNP IGVM file to verify the correct operation of
the new support for ID_BLOCKs in v3.
This patch series requires version v0.3.2 of the IGVM library to be installed
[5].
Changes in v3:
* Added support for SEV-SNP on top of SEV and SEV-ES.
* Introduced a new `IgvmCfg` user accessible object to configure and process the
IGVM file, moving this from `ConfidentialGuestSupport` where it resided in v2.
`ConfidentialGuestSupport` is still used to abstract the implementation of
guest configuration.
* The IGVM processing code will use the `ConfidentialGuestSupport` functions if
provided, but will allow processing of a supported subset of directives if a
CGS instance is not provided, allowing non-confidential guest to be configured
with an IGVM file.
* Added support for setting platform policy via the IGVM file.
* Added ID_BLOCK support as part of SEV-SNP for using the platform to verify the
measurement and signature of the IGVM file.
* Update documentation to describe configuring IGVM using the `igvm-cfg` object
and referring to it from `-machine`.
* Pre-processing of the IGVM file during KVM initialization to determine the
`sev_features` to pass to the new KVM_SEV_INIT2 ioctl.
* Tidying/rework of code as per previous review comments. In particular, the
IGVM library dependency has been updated to remove potential namespace
clashes.
Patch summary:
The patches have been organized so the first patches in the series mostly match
those in v2 but with additional support for SEV-SNP and native platforms.
This hopefully simplifies the review process for those that have already looked
at the previous series.
1-10: Add support and documentation for processing IGVM files for SEV, SEV-ES,
SEV-SNP and native platforms.
11-14: Processing of policy and SEV-SNP ID_BLOCK from IGVM file.
15: Add pre-processing of IGVM file to support synchronization of 'SEV_FEATURES'
from IGVM VMSA to KVM.
[1] Link to v2:
https://lore.kernel.org/qemu-devel/cover.1712138654.git.roy.hopkins@suse.com/
[2] v3 patches also available here:
https://github.com/roy-hopkins/qemu/tree/igvm_master_v3
[3] `buildigvm` tool v0.2.0
https://github.com/roy-hopkins/buildigvm/releases/tag/v0.2.0
[4] `igvmmeasure` tool
https://github.com/coconut-svsm/svsm/tree/main/igvmmeasure
[5] IGVM library v0.3.2
https://github.com/microsoft/igvm/releases/tag/igvm-v0.3.2
Roy Hopkins (15):
meson: Add optional dependency on IGVM library
backends/confidential-guest-support: Add functions to support IGVM
backends/igvm: Add IGVM loader and configuration
hw/core/machine: Add igvm-cfg object and processing for IGVM files
i386/pc_sysfw: Ensure sysfw flash configuration does not conflict with
IGVM
sev: Update launch_update_data functions to use Error handling
i386/sev: Refactor setting of reset vector and initial CPU state
i386/sev: Implement ConfidentialGuestSupport functions for SEV
docs/system: Add documentation on support for IGVM
docs/interop/firmware.json: Add igvm to FirmwareDevice
backends/confidential-guest-support: Add set_guest_policy() function
backends/igvm: Process initialization sections in IGVM file
backends/igvm: Handle policy for SEV guests
i386/sev: Add implementation of CGS set_guest_policy()
sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2
docs/interop/firmware.json | 9 +-
docs/system/i386/amd-memory-encryption.rst | 2 +
docs/system/igvm.rst | 157 ++++
docs/system/index.rst | 1 +
meson.build | 8 +
qapi/qom.json | 16 +
backends/igvm.h | 37 +
include/exec/confidential-guest-support.h | 96 +++
include/hw/boards.h | 2 +
include/sysemu/igvm-cfg.h | 54 ++
target/i386/sev.h | 124 +++
backends/confidential-guest-support.c | 43 +
backends/igvm-cfg.c | 66 ++
backends/igvm.c | 948 +++++++++++++++++++++
hw/core/machine.c | 20 +
hw/i386/pc_sysfw.c | 23 +-
target/i386/sev.c | 830 ++++++++++++++++--
backends/meson.build | 5 +
meson_options.txt | 2 +
qemu-options.hx | 25 +
scripts/meson-buildoptions.sh | 3 +
21 files changed, 2393 insertions(+), 78 deletions(-)
create mode 100644 docs/system/igvm.rst
create mode 100644 backends/igvm.h
create mode 100644 include/sysemu/igvm-cfg.h
create mode 100644 backends/igvm-cfg.c
create mode 100644 backends/igvm.c
--
2.43.0
next reply other threads:[~2024-06-21 14:32 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 14:29 Roy Hopkins [this message]
2024-06-21 14:29 ` [PATCH v3 01/15] meson: Add optional dependency on IGVM library Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 02/15] backends/confidential-guest-support: Add functions to support IGVM Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 03/15] backends/igvm: Add IGVM loader and configuration Roy Hopkins
2024-06-24 13:29 ` Daniel P. Berrangé
2024-06-28 10:59 ` Roy Hopkins
2024-06-27 9:06 ` Stefano Garzarella
2024-06-27 9:14 ` Daniel P. Berrangé
2024-06-28 11:00 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 04/15] hw/core/machine: Add igvm-cfg object and processing for IGVM files Roy Hopkins
2024-06-24 14:00 ` Daniel P. Berrangé
2024-06-28 11:09 ` Roy Hopkins
2024-06-28 11:23 ` Daniel P. Berrangé
2024-07-01 11:59 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 05/15] i386/pc_sysfw: Ensure sysfw flash configuration does not conflict with IGVM Roy Hopkins
2024-06-27 12:38 ` Stefano Garzarella
2024-06-28 11:10 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 06/15] sev: Update launch_update_data functions to use Error handling Roy Hopkins
2024-06-27 12:48 ` Stefano Garzarella
2024-06-28 11:20 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 07/15] i386/sev: Refactor setting of reset vector and initial CPU state Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 08/15] i386/sev: Implement ConfidentialGuestSupport functions for SEV Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 09/15] docs/system: Add documentation on support for IGVM Roy Hopkins
2024-06-24 14:09 ` Daniel P. Berrangé
2024-07-01 14:28 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 10/15] docs/interop/firmware.json: Add igvm to FirmwareDevice Roy Hopkins
2024-06-27 12:53 ` Stefano Garzarella
2024-07-02 10:36 ` Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 11/15] backends/confidential-guest-support: Add set_guest_policy() function Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 12/15] backends/igvm: Process initialization sections in IGVM file Roy Hopkins
2024-06-21 14:29 ` [PATCH v3 13/15] backends/igvm: Handle policy for SEV guests Roy Hopkins
2024-06-24 14:56 ` Daniel P. Berrangé
2024-06-21 14:29 ` [PATCH v3 14/15] i386/sev: Add implementation of CGS set_guest_policy() Roy Hopkins
2024-06-24 14:53 ` Daniel P. Berrangé
2024-06-21 14:29 ` [PATCH v3 15/15] sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2 Roy Hopkins
2024-06-24 14:14 ` Daniel P. Berrangé
2024-07-01 13:50 ` Roy Hopkins
2024-06-24 13:50 ` [PATCH v3 00/15] Introduce support for IGVM files Daniel P. Berrangé
2024-06-28 10:56 ` Roy Hopkins
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=cover.1718979106.git.roy.hopkins@suse.com \
--to=roy.hopkins@suse.com \
--cc=alistair@alistair23.me \
--cc=anisinha@redhat.com \
--cc=berrange@redhat.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=imammedo@redhat.com \
--cc=jroedel@suse.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=slp@redhat.com \
--cc=thomas.lendacky@amd.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).