[PATCH v5 08/16] i386/sev: Refactor setting of reset vector and initial CPU state

2024-08-13 Thread Roy Hopkins via
When an SEV guest is started, the reset vector and state are extracted from metadata that is contained in the firmware volume. In preparation for using IGVM to setup the initial CPU state, the code has been refactored to populate vmcb_save_area for each CPU which is then applied during guest start

[PATCH v5 16/16] sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2

2024-08-13 Thread Roy Hopkins via
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.

[PATCH v5 03/16] backends/igvm: Add IGVM loader and configuration

2024-08-13 Thread Roy Hopkins via
Adds an IGVM loader to QEMU which processes a given IGVM file and applies the directives within the file to the current guest configuration. The IGVM loader can be used to configure both confidential and non-confidential guests. For confidential guests, the ConfidentialGuestSupport object for the

[PATCH v5 04/16] hw/i386: Add igvm-cfg object and processing for IGVM files

2024-08-13 Thread Roy Hopkins via
An IGVM file contains configuration of guest state that should be applied during configuration of the guest, before the guest is started. This patch allows the user to add an igvm-cfg object to an X86 machine configuration that allows an IGVM file to be configured that will be applied to the guest

[PATCH v5 14/16] backends/igvm: Handle policy for SEV guests

2024-08-13 Thread Roy Hopkins via
Adds a handler for the guest policy initialization IGVM section and builds an SEV policy based on this information and the ID block directive if present. The policy is applied using by calling 'set_guest_policy()' on the ConfidentialGuestSupport object. Signed-off-by: Roy Hopkins Acked-by: Michae

[PATCH v5 13/16] backends/igvm: Process initialization sections in IGVM file

2024-08-13 Thread Roy Hopkins via
The initialization sections in IGVM files contain configuration that should be applied to the guest platform before it is started. This includes guest policy and other information that can affect the security level and the startup measurement of a guest. This commit introduces handling of the init

[PATCH v5 07/16] target/i386: Allow setting of R_LDTR and R_TR with cpu_x86_load_seg_cache()

2024-08-13 Thread Roy Hopkins via
The x86 segment registers are identified by the X86Seg enumeration which includes LDTR and TR as well as the normal segment registers. The function 'cpu_x86_load_seg_cache()' uses the enum to determine which segment to set. However, specifying R_LDTR or R_TR results in an out-of-bounds access of th

[PATCH v5 11/16] docs/interop/firmware.json: Add igvm to FirmwareDevice

2024-08-13 Thread Roy Hopkins via
Create an enum entry within FirmwareDevice for 'igvm' to describe that an IGVM file can be used to map firmware into memory as an alternative to pre-existing firmware devices. Signed-off-by: Roy Hopkins Acked-by: Michael S. Tsirkin --- docs/interop/firmware.json | 30 +++

[PATCH v5 01/16] meson: Add optional dependency on IGVM library

2024-08-13 Thread Roy Hopkins via
The IGVM library allows Independent Guest Virtual Machine files to be parsed and processed. IGVM files are used to configure guest memory layout, initial processor state and other configuration pertaining to secure virtual machines. This adds the --enable-igvm configure option, enabled by default,