qemu/backends
Roy Hopkins d60238b4c1 sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2
IGVM files can contain an initial VMSA that should be applied to each
vcpu as part of the initial guest state. The sev_features flags are
provided as part of the VMSA structure. However, KVM only allows
sev_features to be set during initialization and not as the guest is
being prepared for launch.

This patch queries KVM for the supported set of sev_features flags and
processes the VP context entries in the IGVM file during kvm_init to
determine any sev_features flags set in the IGVM file. These are then
provided in the call to KVM_SEV_INIT2 to ensure the guest state
matches that specified in the IGVM file.

The igvm process() function is modified to allow a partial processing
of the file during initialization, with only the IGVM_VHT_VP_CONTEXT
fields being processed. This means the function is called twice,
firstly to extract the sev_features then secondly to actually
configure the guest.

Signed-off-by: Roy Hopkins <roy.hopkins@randomman.co.uk>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Gerd Hoffman <kraxel@redhat.com>
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Link: https://lore.kernel.org/r/b2f986aae04e1da2aee530c9be22a54c0c59a560.1751554099.git.roy.hopkins@randomman.co.uk
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-12 15:28:21 +02:00
..
tpm backends/tpm: Avoid using g_alloca() 2025-06-10 12:59:09 +02:00
confidential-guest-support.c backends/confidential-guest-support: Add set_guest_policy() function 2025-07-12 15:28:21 +02:00
cryptodev-builtin.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
cryptodev-hmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
cryptodev-lkcf.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
cryptodev-vhost-user.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
cryptodev-vhost.c cryptodev/vhost: allocate CryptoDevBackendVhost using g_mem0() 2025-02-21 07:18:42 -05:00
cryptodev.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
dbus-vmstate1.xml docs: move D-Bus VMState documentation to source XML 2021-12-21 10:50:21 +04:00
dbus-vmstate.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
host_iommu_device.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem-epc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem-file.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem-memfd.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem-ram.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem-shm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
hostmem.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
igvm-cfg.c backends/igvm: Add IGVM loader and configuration 2025-07-12 15:28:21 +02:00
igvm.c sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2 2025-07-12 15:28:21 +02:00
igvm.h sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2 2025-07-12 15:28:21 +02:00
iommufd.c iommufd: preserve DMA mappings 2025-07-03 13:42:28 +02:00
Kconfig backends: Initial support for SPDM socket support 2024-07-22 20:15:42 -04:00
meson.build backends/igvm: Add IGVM loader and configuration 2025-07-12 15:28:21 +02:00
rng-builtin.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rng-egd.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rng-random.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rng.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
spdm-socket.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
trace-events backends/iommufd: change process ioctl 2025-07-03 13:42:28 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vhost-user.c vhost-user: return failure if backend crash when live migration 2025-05-14 05:39:15 -04:00