igvm: Supply MADT via IGVM parameter
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest9 patches 0 repliesNew
- v5 posting 2/26 patches 4 repliesSuperseded
- v5 posting 1/23 of 6 patches 0 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 5 patches | 4 replies | Superseded | |
| v3 | 6 patches | 12 replies | Superseded | |
| v2 | 3 patches | 6 replies | Superseded | |
| v1 | 3 patches | 3 replies | Superseded |
Changes in v6 from the cover letter
- Fix errors on non-i386 architectures
- Only build IGVM stubs file if feature is enabled.
- Move IGVM-related struct definitions to an internal header
- Move IGVM parameter handler for MADT to i386 code and stub it for other architectures
- Reuse existing ACPI checksum function instead of adding a new one
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | hw/acpi: Make acpi_checksum() publichw/ include/ | +7 | 0 replies | |
| 2/9 | hw/acpi: Make BIOS linker optionalhw/ | +10 | 0 replies | |
| 3/9 | hw/acpi: Add standalone function to build MADThw/ hw/ | +11 | 0 replies | |
| 4/9 | igvm: Move structs to internal headerbackends/ include/ | +40 | 0 replies | |
| 5/9 | igvm: Add common function for finding parameter entriesbackends/ include/ | +80 | 0 replies | |
| 6/9 | igvm: Refactor qigvm_parameter_insertbackends/ | +25 | 0 replies | |
| 7/9 | igvm: Pass machine state to IGVM file processingbackends/ backends/ include/ +3 more | +25 | 0 replies | |
| 8/9 | igvm: Only build stubs if igvm is enabledstubs/ | +3 | 0 replies | |
| 9/9 | igvm: Fill MADT IGVM parameter field on x86_64backends/ include/ stubs/ +1 more | +45 | 0 replies |
Reviews trailers per patch
3 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Luigi Leonardi |
|---|---|
| 1/9 | |
| 2/9 | |
| 3/9 | |
| 4/9 | |
| 5/9 | R-b |
| 6/9 | R-b |
| 7/9 | R-b |
| 8/9 | |
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/9] igvm: Supply MADT via IGVM parameter
When launching using an IGVM file, supply a copy of the MADT (part of the ACPI tables) via an IGVM parameter (IGVM_VHY_MADT) to the guest, in addition to the regular fw_cfg mechanism.
The IGVM parameter can be consumed by Coconut SVSM [1], instead of relying on the fw_cfg interface, which has caused problems before due to unexpected access [2,3]. Using IGVM parameters is the default way for Coconut SVSM; switching over would allow removing specialized code paths for QEMU in Coconut.
Coconut SVSM needs to know the SMP configuration, but does not look at any other ACPI data, nor does it interact with the PCI bus settings. Since the MADT is static and not linked with other ACPI tables, it can be supplied stand-alone like this.
Generating the MADT twice (IGVM processing and ACPI table building) seems acceptable, since there is no infrastructure to obtain the MADT out of the ACPI table memory area during IGVM processing.
In any case OVMF, which runs after SVSM has already been initialized, will continue reading all ACPI tables via fw_cfg and provide fixed up ACPI data to the OS as before.
This series makes ACPI table building more generic by making the BIOS linker optional. This allows the MADT to be generated outside of the ACPI build context. A new function (acpi_build_madt_standalone()) is added for that. With that, the IGVM MADT parameter field can be filled with the MADT data during processing of the IGVM file.
[1] https://github.com/coconut-svsm/svsm/pull/858
[2] https://gitlab.com/qemu-project/qemu/-/issues/2882
[3] https://github.com/coconut-svsm/svsm/issues/646
v6:
- Fix errors on non-i386 architectures
- Only build IGVM stubs file if feature is enabled.
- Move IGVM-related struct definitions to an internal header
- Move IGVM parameter handler for MADT to i386 code and stub it for other architectures
- Reuse existing ACPI checksum function instead of adding a new one
v5:
- Rebase on latest IGVM rework series from Gerd
- Make qigvm_find_parameter_entry() more generic and use everywhere possible; It now takes the index as input, instead of the full parameter struct
- Consistently use early returns when looking up parameter entries
- Emit a warning message if no parameter area can be found for a given index
v4:
- Add ACPI table checksum calculation without BIOS linker, used for the standalone MADT.
- Don't pass ConfidentialGuestState into the IGVM backend anymore. Not needed, since we already have the full MachineState there now.
- Move the NULL check patch out into a new series (to be posted).
- Address remaining cleanup comments.
v3:
- Pass the machine state into IGVM file processing context instead of MADT data
- Generate MADT from inside the IGVM backend
- Refactor: Extract common code for finding IGVM parameter from IGVM parameter handlers
- Add NULL pointer check for igvm_get_buffer()
v2:
- Provide more context in the message of the main commit
- Document the MADT parameter of IgvmCfgClass::process()
- Document why no MADT data is provided the process call in sev.c
Based-on: <[email protected]>
Oliver Steffen (9):
hw/acpi: Make acpi_checksum() public
hw/acpi: Make BIOS linker optional
hw/acpi: Add standalone function to build MADT
igvm: Move structs to internal header
igvm: Add common function for finding parameter entries
igvm: Refactor qigvm_parameter_insert
igvm: Pass machine state to IGVM file processing
igvm: Only build stubs if igvm is enabled
igvm: Fill MADT IGVM parameter field on x86_64
backends/igvm-cfg.c | 2 +- backends/igvm.c | 256 +++++++++++++++------------------ hw/acpi/aml-build.c | 12 +- hw/acpi/core.c | 5 +- hw/i386/acpi-build.c | 9 ++ hw/i386/acpi-build.h | 2 + include/hw/acpi/acpi.h | 3 + include/system/igvm-cfg.h | 3 +- include/system/igvm-internal.h | 49 +++++++ include/system/igvm.h | 5 +- stubs/igvm.c | 6 + stubs/meson.build | 4 +- target/i386/igvm.c | 32 +++++ target/i386/sev.c | 3 +- 14 files changed, 243 insertions(+), 148 deletions(-)
Signature · 1 line
2.52.0