From ef92a77b3ee992874c728bd73a732fa15a76eb51 Mon Sep 17 00:00:00 2001 From: Zhenchao Liu Date: Mon, 22 Apr 2024 16:22:07 +0800 Subject: [PATCH] Fixed issues to support Intel TDX 1. Removed kvm-type from -machine options 2. Workaround the firmware setting by bios_path Signed-off-by: Zhenchao Liu --- virttest/qemu_devices/qcontainer.py | 8 ++++++-- virttest/qemu_vm.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/virttest/qemu_devices/qcontainer.py b/virttest/qemu_devices/qcontainer.py index ebce9ecaad..008a1454be 100644 --- a/virttest/qemu_devices/qcontainer.py +++ b/virttest/qemu_devices/qcontainer.py @@ -1390,8 +1390,12 @@ def machine_q35(machine_params): ), qdevices.QCPUBus(params.get("cpu_model"), [[""], [0]], "vcpu"), ) - pflash_devices = pflash_handler("ovmf", machine_params) - devices.extend(pflash_devices) + + # FIXME: Use -bios option to set firmware for a tdx vm + if params.get("vm_secure_guest_type") != "tdx": + pflash_devices = pflash_handler("ovmf", machine_params) + devices.extend(pflash_devices) + devices.append( qdevices.QMachine(params=machine_params, child_bus=bus, aobject="pci.0") ) diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py index 01541c4d2d..e7bbf9817a 100644 --- a/virttest/qemu_vm.py +++ b/virttest/qemu_vm.py @@ -1694,7 +1694,7 @@ def add_secure_guest_descriptor(params): sectype = params["vm_secure_guest_type"] sev_mach_props = {} - tdx_mach_props = {"kvm-type": "tdx"} + tdx_mach_props = {} backend_props = {"sev": sev_mach_props, "tdx": tdx_mach_props} for k, v in backend_props.get(sectype, {}).items(): machine_dev.set_param(k, v)