Skip to content

Commit

Permalink
Fixed issues to support Intel TDX
Browse files Browse the repository at this point in the history
1. Removed kvm-type from -machine options
2. Workaround the firmware setting by bios_path

Signed-off-by: Zhenchao Liu <[email protected]>
  • Loading branch information
zhencliu committed May 11, 2024
1 parent fb4d362 commit ef92a77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions virttest/qemu_devices/qcontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
2 changes: 1 addition & 1 deletion virttest/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef92a77

Please sign in to comment.