]> git.ipfire.org Git - thirdparty/qemu.git/commit
i386/tdx: Track mem_ptr for each firmware entry of TDVF
authorXiaoyao Li <xiaoyao.li@intel.com>
Thu, 8 May 2025 14:59:26 +0000 (10:59 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 28 May 2025 17:01:41 +0000 (19:01 +0200)
commit4420ba0ebbf014acc68f78669e0767e288313ed6
treed4c3f3d6801f946ba27ec07551118e032351dd65
parent49b1f0f812372129736c1df0421c8f67d86d362b
i386/tdx: Track mem_ptr for each firmware entry of TDVF

For each TDVF sections, QEMU needs to copy the content to guest
private memory via KVM API (KVM_TDX_INIT_MEM_REGION).

Introduce a field @mem_ptr for TdxFirmwareEntry to track the memory
pointer of each TDVF sections. So that QEMU can add/copy them to guest
private memory later.

TDVF sections can be classified into two groups:
 - Firmware itself, e.g., TDVF BFV and CFV, that located separately from
   guest RAM. Its memory pointer is the bios pointer.

 - Sections located at guest RAM, e.g., TEMP_MEM and TD_HOB.
   mmap a new memory range for them.

Register a machine_init_done callback to do the stuff.

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-21-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/tdvf.c
include/hw/i386/tdvf.h
target/i386/kvm/tdx.c