[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 13/16] backends/igvm: Process initialization sections in IGVM
|
From: |
Roy Hopkins |
|
Subject: |
[PATCH v5 13/16] backends/igvm: Process initialization sections in IGVM file |
|
Date: |
Tue, 13 Aug 2024 16:01:15 +0100 |
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 initialization sections during
processing of the IGVM file.
Signed-off-by: Roy Hopkins <roy.hopkins@suse.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
---
backends/igvm.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/backends/igvm.c b/backends/igvm.c
index 7a3fedcc76..9120922a95 100644
--- a/backends/igvm.c
+++ b/backends/igvm.c
@@ -787,6 +787,27 @@ int qigvm_process_file(IgvmCfg *cfg,
ConfidentialGuestSupport *cgs,
}
}
+ header_count =
+ igvm_header_count(ctx.file, IGVM_HEADER_SECTION_INITIALIZATION);
+ if (header_count < 0) {
+ error_setg(
+ errp,
+ "Invalid initialization header count in IGVM file. Error code: %X",
+ header_count);
+ return -1;
+ }
+
+ for (ctx.current_header_index = 0;
+ ctx.current_header_index < (unsigned)header_count;
+ ctx.current_header_index++) {
+ IgvmVariableHeaderType type =
+ igvm_get_header_type(ctx.file, IGVM_HEADER_SECTION_INITIALIZATION,
+ ctx.current_header_index);
+ if (qigvm_handler(&ctx, type, errp) < 0) {
+ goto cleanup;
+ }
+ }
+
/*
* Contiguous pages of data with compatible flags are grouped together in
* order to reduce the number of memory regions we create. Make sure the
--
2.43.0
- Re: [PATCH v5 01/16] meson: Add optional dependency on IGVM library, (continued)
- [PATCH v5 05/16] i386/pc_sysfw: Ensure sysfw flash configuration does not conflict with IGVM, Roy Hopkins, 2024/08/13
- [PATCH v5 06/16] sev: Update launch_update_data functions to use Error handling, Roy Hopkins, 2024/08/13
- [PATCH v5 03/16] backends/igvm: Add IGVM loader and configuration, Roy Hopkins, 2024/08/13
- [PATCH v5 07/16] target/i386: Allow setting of R_LDTR and R_TR with cpu_x86_load_seg_cache(), Roy Hopkins, 2024/08/13
- [PATCH v5 02/16] backends/confidential-guest-support: Add functions to support IGVM, Roy Hopkins, 2024/08/13
- [PATCH v5 04/16] hw/i386: Add igvm-cfg object and processing for IGVM files, Roy Hopkins, 2024/08/13
- [PATCH v5 08/16] i386/sev: Refactor setting of reset vector and initial CPU state, Roy Hopkins, 2024/08/13
- [PATCH v5 09/16] i386/sev: Implement ConfidentialGuestSupport functions for SEV, Roy Hopkins, 2024/08/13
- [PATCH v5 13/16] backends/igvm: Process initialization sections in IGVM file,
Roy Hopkins <=
- [PATCH v5 14/16] backends/igvm: Handle policy for SEV guests, Roy Hopkins, 2024/08/13
- [PATCH v5 11/16] docs/interop/firmware.json: Add igvm to FirmwareDevice, Roy Hopkins, 2024/08/13
- [PATCH v5 15/16] i386/sev: Add implementation of CGS set_guest_policy(), Roy Hopkins, 2024/08/13
- [PATCH v5 12/16] backends/confidential-guest-support: Add set_guest_policy() function, Roy Hopkins, 2024/08/13
- [PATCH v5 16/16] sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2, Roy Hopkins, 2024/08/13
- [PATCH v5 10/16] docs/system: Add documentation on support for IGVM, Roy Hopkins, 2024/08/13