qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/15] Introduce support for IGVM files
@ 2024-06-21 14:29 Roy Hopkins
  2024-06-21 14:29 ` [PATCH v3 01/15] meson: Add optional dependency on IGVM library Roy Hopkins
                   ` (15 more replies)
  0 siblings, 16 replies; 39+ messages in thread
From: Roy Hopkins @ 2024-06-21 14:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Roy Hopkins, Paolo Bonzini, Daniel P . Berrangé,
	Stefano Garzarella, Marcelo Tosatti, Michael S . Tsirkin,
	Cornelia Huck, Marcel Apfelbaum, Sergio Lopez, Eduardo Habkost,
	Alistair Francis, Peter Xu, David Hildenbrand, Igor Mammedov,
	Tom Lendacky, Michael Roth, Ani Sinha, Jörg Roedel

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



^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2024-07-02 10:37 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21 14:29 [PATCH v3 00/15] Introduce support for IGVM files Roy Hopkins
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

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).