On Tue, Apr 01, 2025 at 09:01:30AM -0400, Xiaoyao Li wrote: > Date: Tue, 1 Apr 2025 09:01:30 -0400 > From: Xiaoyao Li <xiaoyao...@intel.com> > Subject: [PATCH v8 20/55] i386/tdx: Track mem_ptr for each firmware entry > of TDVF > X-Mailer: git-send-email 2.34.1 > > 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...@intel.com> > Acked-by: Gerd Hoffmann <kra...@redhat.com> > --- > Changes in v8: > - Remove the duplicated header include; > - Add error handling for qemu_ram_mmap() failure; > --- > hw/i386/tdvf.c | 1 + > include/hw/i386/tdvf.h | 7 +++++++ > target/i386/kvm/tdx.c | 37 +++++++++++++++++++++++++++++++++++++ > 3 files changed, 45 insertions(+)
Reviewed-by: Zhao Liu <zhao1....@intel.com>