]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/tdvf: Introduce function to parse TDVF metadata
authorIsaku Yamahata <isaku.yamahata@intel.com>
Thu, 8 May 2025 14:59:23 +0000 (10:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 28 May 2025 17:01:41 +0000 (19:01 +0200)
commitb65a6011d16c4f7cb2eb227ab1bc735850475288
tree1f7f2c99aa68f5d70226c6bf2e16aba40d099bd8
parent0dd5fe5ebeabefc7b3d7f043991b1edfe6b8eda9
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>
hw/i386/Kconfig
hw/i386/meson.build
hw/i386/tdvf.c [new file with mode: 0644]
include/hw/i386/tdvf.h [new file with mode: 0644]