qemu/include/hw/i386
Isaku Yamahata b65a6011d1 i386/tdvf: Introduce function to parse TDVF metadata
TDX VM needs to boot with its specialized firmware, Trusted Domain
Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD
guest memory prior to running the TDX VM.

A TDVF Metadata in TDVF image describes the structure of firmware.
QEMU refers to it to setup memory for TDVF. Introduce function
tdvf_parse_metadata() to parse the metadata from TDVF image and store
the info of each TDVF section.

TDX metadata is located by a TDX metadata offset block, which is a
GUID-ed structure. The data portion of the GUID structure contains
only an 4-byte field that is the offset of TDX metadata to the end
of firmware file.

Select X86_FW_OVMF when TDX is enable to leverage existing functions
to parse and search OVMF's GUID-ed structures.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250508150002.689633-18-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-28 19:01:41 +02:00
..
apic-msidef.h i386/msi: Correct mask of destination ID in MSI address 2017-12-01 18:28:15 +02:00
apic.h hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled 2024-02-14 06:09:32 -05:00
apic_internal.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
hostmem-epc.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
intel_iommu.h tests/qtest: Add intel-iommu test 2025-01-15 13:06:39 -05:00
microvm.h machine/nitro-enclave: New machine type for AWS Nitro Enclaves 2024-10-31 18:28:33 +01:00
nitro_enclave.h hw/core/eif: Use stateful qcrypto apis 2024-12-13 15:26:58 +01:00
pc.h qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sgx-epc.h target/i386/cpu: Mask off SGX/SGX_LC feature words for non-PC machine 2024-07-31 13:13:31 +02:00
tdvf.h i386/tdvf: Introduce function to parse TDVF metadata 2025-05-28 19:01:41 +02:00
topology.h i386/topology: Introduce helpers for various topology info of different level 2025-01-10 23:34:45 +01:00
vmport.h hw/i386/vmport: Drop superfluous parenthesis around function typedef 2020-09-18 13:49:54 -04:00
x86-iommu.h include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts 2023-08-03 16:16:17 -04:00
x86.h include/system: Move exec/memory.h to system/memory.h 2025-04-23 14:08:21 -07:00
xen_arch_hvm.h xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common 2023-06-15 16:45:59 -07:00