Skip to content

QEMU TDX support

Xiaoyao Li kvm qemu-devel 9 versions – Applied

Status from this message: Queued, thanks for your patience - this was a huge effort.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest55 patches 7 repliesApplied
  2. v855 patches 105 repliesSuperseded
  3. v752 patches 28 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v660 patches64 repliesSuperseded
v565 patches58 repliesSuperseded
v466 patches27 repliesSuperseded
v370 patches90 repliesSuperseded
v2 RFC21 patches30 repliesSuperseded
v1 RFC19 patches33 repliesSuperseded

Patches in v9 Applied

#Subject and filesSizeRepliesApplied
1/55*** HACK *** linux-headers: Update headers to pull in TDX API changeslinux-headers/asm-x86/kvm.h linux-headers/linux/kvm.h+70 -00 replies
2/55i386: Introduce tdx-guest objectconfigs/devices/i386-softmmu/default.mak hw/i386/Kconfig qapi/qom.json +3 more+87 -00 replies
3/55i386/tdx: Implement tdx_kvm_type() for TDXtarget/i386/kvm/kvm.c target/i386/kvm/tdx.c+13 -00 replies
4/55i386/tdx: Implement tdx_kvm_init() to initialize TDX VM contexttarget/i386/kvm/kvm.c target/i386/kvm/tdx.c+11 -100 replies
5/55i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIEStarget/i386/kvm/kvm.c target/i386/kvm/kvm_i386.h target/i386/kvm/tdx.c+108 -30 replies
6/55i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest objecttarget/i386/kvm/tdx.c target/i386/kvm/tdx.h+24 -10 replies
7/55kvm: Introduce kvm_arch_pre_create_vcpu()accel/kvm/kvm-all.c include/system/kvm.h target/arm/kvm.c +6 more+40 -00 replies
8/55i386/tdx: Initialize TDX before creating TD vcpustarget/i386/kvm/kvm.c target/i386/kvm/kvm_i386.h target/i386/kvm/meson.build +3 more+137 -70 replies
9/55i386/tdx: Add property sept-ve-disable for tdx-guest objectqapi/qom.json target/i386/kvm/tdx.c+30 -10 replies
10/55i386/tdx: Make sept_ve_disable set by defaulttarget/i386/kvm/tdx.c+1 -10 replies
11/55i386/tdx: Wire CPU features up with attributes of TD guesttarget/i386/kvm/tdx.c+13 -00 replies
12/55i386/tdx: Validate TD attributestarget/i386/kvm/tdx.c+31 -21 reply
13/55i386/tdx: Support user configurable mrconfigid/mrowner/mrownerconfigqapi/qom.json target/i386/kvm/tdx.c target/i386/kvm/tdx.h+113 -12 replies
14/55i386/tdx: Set APIC bus rate to match with what TDX module enforcestarget/i386/kvm/tdx.c target/i386/kvm/tdx.h+16 -00 replies
15/55i386/tdx: Implement user specified tsc frequencytarget/i386/kvm/kvm.c target/i386/kvm/tdx.c+34 -00 replies
16/55i386/tdx: load TDVF for TD guesthw/i386/x86-common.c target/i386/kvm/tdx.c target/i386/kvm/tdx.h+14 -10 replies
17/55i386/tdvf: Introduce function to parse TDVF metadatahw/i386/Kconfig hw/i386/meson.build hw/i386/tdvf.c +1 more+227 -00 replies
18/55i386/tdx: Parse TDVF metadata for TDX VMhw/i386/pc_sysfw.c target/i386/kvm/tdx-stub.c target/i386/kvm/tdx.c +1 more+20 -00 replies
19/55i386/tdx: Don't initialize pc.rom for TDX VMshw/i386/pc.c+16 -130 replies
20/55i386/tdx: Track mem_ptr for each firmware entry of TDVFhw/i386/tdvf.c include/hw/i386/tdvf.h target/i386/kvm/tdx.c+45 -00 replies
21/55i386/tdx: Track RAM entries for TDX VMtarget/i386/kvm/tdx.c target/i386/kvm/tdx.h+130 -00 replies
22/55headers: Add definitions from UEFI spec for volumes, resources, etc...include/standard-headers/uefi/uefi.h+187 -00 replies
23/55i386/tdx: Setup the TD HOB listhw/i386/meson.build hw/i386/tdvf-hob.c hw/i386/tdvf-hob.h +1 more+173 -10 replies
24/55i386/tdx: Add TDVF memory via KVM_TDX_INIT_MEM_REGIONtarget/i386/kvm/tdx.c+42 -00 replies
25/55i386/tdx: Call KVM_TDX_INIT_VCPU to initialize TDX vcputarget/i386/kvm/tdx.c+14 -00 replies
26/55i386/tdx: Finalize TDX VMtarget/i386/kvm/tdx.c+3 -00 replies
27/55i386/tdx: Enable user exit on KVM_HC_MAP_GPA_RANGEtarget/i386/kvm/tdx.c+7 -00 replies
28/55i386/tdx: Handle KVM_SYSTEM_EVENT_TDX_FATALtarget/i386/kvm/kvm.c target/i386/kvm/tdx-stub.c target/i386/kvm/tdx.c +1 more+63 -00 replies
29/55i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facilityqapi/run-state.json system/runstate.c target/i386/kvm/tdx.c+118 -30 replies
30/55kvm: Check KVM_CAP_MAX_VCPUS at vm levelaccel/kvm/kvm-all.c+1 -10 replies
31/55i386/cpu: introduce x86_confidential_guest_cpu_instance_init()target/i386/confidential-guest.h target/i386/cpu.c+19 -00 replies
32/55i386/tdx: implement tdx_cpu_instance_init()target/i386/kvm/tdx.c+6 -00 replies
33/55i386/cpu: Introduce enable_cpuid_0x1f to force exposing CPUID 0x1ftarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/kvm.c+12 -30 replies
34/55i386/tdx: Force exposing CPUID 0x1ftarget/i386/kvm/tdx.c+4 -00 replies
35/55i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VMtarget/i386/kvm/tdx.c+9 -00 replies
36/55i386/tdx: Disable SMM for TDX VMstarget/i386/kvm/tdx.c+9 -00 replies
37/55i386/tdx: Disable PIC for TDX VMstarget/i386/kvm/tdx.c+7 -00 replies
38/55i386/tdx: Set and check kernel_irqchip mode for TDXtarget/i386/kvm/tdx.c+8 -00 replies
39/55i386/tdx: Don't synchronize guest tsc for TDstarget/i386/kvm/kvm.c+1 -10 replies
40/55i386/tdx: Only configure MSR_IA32_UCODE_REV in kvm_init_msrs() for TDstarget/i386/kvm/kvm.c+23 -210 replies
41/55i386/apic: Skip kvm_apic_put() for TDXhw/i386/kvm/apic.c+5 -00 replies
42/55cpu: Don't set vcpu_dirty when guest_state_protectedaccel/kvm/kvm-all.c+3 -10 replies
43/55i386/cgs: Rename *mask_cpuid_features() to *adjust_cpuid_features()target/i386/confidential-guest.h target/i386/kvm/kvm.c target/i386/sev.c+13 -130 replies
44/55i386/tdx: Implement adjust_cpuid_features() for TDXtarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/kvm.c +2 more+53 -10 replies
45/55i386/tdx: Add TDX fixed1 bits to supported CPUIDstarget/i386/cpu.h target/i386/kvm/kvm_i386.h target/i386/kvm/tdx.c +1 more+143 -80 replies
46/55i386/tdx: Add supported CPUID bits related to TD Attributestarget/i386/cpu.h target/i386/kvm/tdx.c+64 -00 replies
47/55i386/tdx: Add supported CPUID bits relates to XFAMtarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/tdx.c+89 -120 replies
48/55i386/tdx: Add XFD to supported bit of TDXtarget/i386/cpu.h target/i386/kvm/tdx.c+7 -00 replies
49/55i386/tdx: Define supported KVM features for TDXtarget/i386/kvm/tdx.c+20 -00 replies
50/55i386/cgs: Introduce x86_confidential_guest_check_features()target/i386/confidential-guest.h target/i386/kvm/kvm.c+21 -00 replies
51/55i386/tdx: Fetch and validate CPUID of TD guesttarget/i386/cpu.c target/i386/cpu.h target/i386/kvm/tdx.c+139 -20 replies
52/55i386/tdx: Don't treat SYSCALL as unavailabletarget/i386/kvm/tdx.c+13 -00 replies
53/55i386/tdx: Make invtsc default ontarget/i386/kvm/tdx.c+3 -00 replies
54/55i386/tdx: Validate phys_bits against host valuetarget/i386/host-cpu.c target/i386/host-cpu.h target/i386/kvm/tdx.c+10 -10 replies
55/55docs: Add TDX documentationdocs/system/confidential-guest-support.rst docs/system/i386/tdx.rst docs/system/target-i386.rst+163 -00 replies

Reviews trailers per patch

49 of 55 patches have a Reviewed-by or Acked-by.

PatchGerd HoffmannMarkus ArmbrusterDaniel P. BerrangéZhao LiuIsaku YamahataConnor Kuehl
1/55
2/55A-b A-b R-b R-b
3/55R-b R-b
4/55R-b R-b
5/55
6/55A-b R-b R-b
7/55A-b R-b R-b
8/55A-b A-b R-b
9/55A-b A-b R-b R-b
10/55R-b R-b
11/55A-b R-b R-b
12/55A-b R-b R-b
13/55A-b R-b
14/55R-b R-b
15/55A-b R-b R-b
16/55R-b
17/55A-b R-b
18/55A-b R-b R-b
19/55R-b
20/55A-b R-b
21/55A-b R-b
22/55A-b R-b
23/55A-b R-b
24/55A-b R-b
25/55A-b R-b
26/55A-b R-b
27/55R-b
28/55R-b
29/55A-b R-b
30/55R-b
31/55R-b
32/55R-b
33/55R-b
34/55R-b
35/55A-b R-b
36/55A-b R-b R-b
37/55A-b R-b R-b
38/55R-b R-b
39/55A-b R-b R-b
40/55A-b R-b
41/55R-b
42/55R-b
43/55R-b R-b
44/55R-b
45/55R-b
46/55
47/55
48/55R-b
49/55R-b
50/55R-b
51/55
52/55R-b
53/55R-b
54/55R-b R-b
55/55

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/55] QEMU TDX support

This is the v9 series of TDX QEMU enabling. The series is also available at github:
https://github.com/intel-staging/qemu-tdx/tree/tdx-qemu-upstream-v9

Note, this series has a dependency on
https://lore.kernel.org/qemu-devel/[email protected]/

=============
Changes in v9

Comparing to v8, no big change in v9.

V9 mainly collects Reviewed-by tags from Daniel and Zhao Liu (Thanks to their review!) and v9 does some small change according to the review feedback of them. Please see the individual patch for the detailed change history.

===========
future work

- CPU model

It now only supports booting TD VM with "-cpu host". It is the only case that is not supposed to hit any warning/error.

When using named CPU model, even the same model as host, it likely hits warning like some feature not supported or some feature enforced on. It's a future work to decide if needs to introduce TDX specific named CPU models.

- Attestation support

Atttestation support will be submitted separately since it depends on the GHCI clarification on the format of the datai filed of the shared buffer of <GetQuote>.[1]

- gdb support

gdb support to debug a TD in off-debug mode is left as future work.

[1] https://lore.kernel.org/qemu-devel/[email protected]/

=======
history

v8: https://lore.kernel.org/qemu-devel/[email protected]/

v7: https://lore.kernel.org/qemu-devel/[email protected]/

Chao Peng (1):
i386/tdx: load TDVF for TD guest

Isaku Yamahata (5):
i386/tdx: Make sept_ve_disable set by default
i386/tdx: Support user configurable mrconfigid/mrowner/mrownerconfig i386/tdvf: Introduce function to parse TDVF metadata i386/tdx: Add TDVF memory via KVM_TDX_INIT_MEM_REGION i386/tdx: Don't synchronize guest tsc for TDs

Xiaoyao Li (49):
*** HACK *** linux-headers: Update headers to pull in TDX API changes
i386: Introduce tdx-guest object
i386/tdx: Implement tdx_kvm_type() for TDX
i386/tdx: Implement tdx_kvm_init() to initialize TDX VM context i386/tdx: Get tdx_capabilities via KVM_TDX_CAPABILITIES i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object
kvm: Introduce kvm_arch_pre_create_vcpu()
i386/tdx: Initialize TDX before creating TD vcpus i386/tdx: Add property sept-ve-disable for tdx-guest object i386/tdx: Wire CPU features up with attributes of TD guest i386/tdx: Validate TD attributes
i386/tdx: Set APIC bus rate to match with what TDX module enforces i386/tdx: Implement user specified tsc frequency
i386/tdx: Parse TDVF metadata for TDX VM
i386/tdx: Don't initialize pc.rom for TDX VMs
i386/tdx: Track mem_ptr for each firmware entry of TDVF i386/tdx: Track RAM entries for TDX VM
headers: Add definitions from UEFI spec for volumes, resources, etc... i386/tdx: Setup the TD HOB list
i386/tdx: Call KVM_TDX_INIT_VCPU to initialize TDX vcpu i386/tdx: Finalize TDX VM
i386/tdx: Enable user exit on KVM_HC_MAP_GPA_RANGE i386/tdx: Handle KVM_SYSTEM_EVENT_TDX_FATAL
i386/tdx: Wire TDX_REPORT_FATAL_ERROR with GuestPanic facility
kvm: Check KVM_CAP_MAX_VCPUS at vm level
i386/cpu: introduce x86_confidential_guest_cpu_instance_init() i386/tdx: implement tdx_cpu_instance_init()
i386/cpu: Introduce enable_cpuid_0x1f to force exposing CPUID 0x1f i386/tdx: Force exposing CPUID 0x1f
i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM i386/tdx: Disable SMM for TDX VMs
i386/tdx: Disable PIC for TDX VMs
i386/tdx: Set and check kernel_irqchip mode for TDX i386/tdx: Only configure MSR_IA32_UCODE_REV in kvm_init_msrs() for TDs i386/apic: Skip kvm_apic_put() for TDX
cpu: Don't set vcpu_dirty when guest_state_protected i386/cgs: Rename *mask_cpuid_features() to *adjust_cpuid_features() i386/tdx: Implement adjust_cpuid_features() for TDX i386/tdx: Add TDX fixed1 bits to supported CPUIDs i386/tdx: Add supported CPUID bits related to TD Attributes i386/tdx: Add supported CPUID bits relates to XFAM i386/tdx: Add XFD to supported bit of TDX
i386/tdx: Define supported KVM features for TDX
i386/cgs: Introduce x86_confidential_guest_check_features() i386/tdx: Fetch and validate CPUID of TD guest
i386/tdx: Don't treat SYSCALL as unavailable
i386/tdx: Make invtsc default on
i386/tdx: Validate phys_bits against host value
docs: Add TDX documentation

 accel/kvm/kvm-all.c                        |   11 +-
 configs/devices/i386-softmmu/default.mak   |    1 +
 docs/system/confidential-guest-support.rst |    1 +
 docs/system/i386/tdx.rst                   |  161 +++
 docs/system/target-i386.rst                |    1 +
 hw/i386/Kconfig                            |    6 +
 hw/i386/kvm/apic.c                         |    5 +
 hw/i386/meson.build                        |    1 +
 hw/i386/pc.c                               |   29 +-
 hw/i386/pc_sysfw.c                         |    7 +
 hw/i386/tdvf-hob.c                         |  130 ++
 hw/i386/tdvf-hob.h                         |   26 +
 hw/i386/tdvf.c                             |  188 +++
 hw/i386/x86-common.c                       |    6 +-
 include/hw/i386/tdvf.h                     |   45 +
 include/standard-headers/uefi/uefi.h       |  187 +++
 include/system/kvm.h                       |    1 +
 linux-headers/asm-x86/kvm.h                |   69 ++
 linux-headers/linux/kvm.h                  |    1 +
 qapi/qom.json                              |   35 +
 qapi/run-state.json                        |   31 +-
 system/runstate.c                          |   65 +
 target/arm/kvm.c                           |    5 +
 target/i386/confidential-guest.h           |   44 +-
 target/i386/cpu.c                          |   69 +-
 target/i386/cpu.h                          |   40 +
 target/i386/host-cpu.c                     |    2 +-
 target/i386/host-cpu.h                     |    1 +
 target/i386/kvm/kvm.c                      |  114 +-
 target/i386/kvm/kvm_i386.h                 |   15 +
 target/i386/kvm/meson.build                |    2 +
 target/i386/kvm/tdx-stub.c                 |   20 +
 target/i386/kvm/tdx.c                      | 1296 ++++++++++++++++++++
 target/i386/kvm/tdx.h                      |   65 +
 target/i386/sev.c                          |   12 +-
 target/loongarch/kvm/kvm.c                 |    4 +
 target/mips/kvm.c                          |    5 +
 target/ppc/kvm.c                           |    5 +
 target/riscv/kvm/kvm-cpu.c                 |    5 +
 target/s390x/kvm/kvm.c                     |    5 +
 40 files changed, 2620 insertions(+), 96 deletions(-)
 create mode 100644 docs/system/i386/tdx.rst
 create mode 100644 hw/i386/tdvf-hob.c
 create mode 100644 hw/i386/tdvf-hob.h
 create mode 100644 hw/i386/tdvf.c
 create mode 100644 include/hw/i386/tdvf.h
 create mode 100644 include/standard-headers/uefi/uefi.h
 create mode 100644 target/i386/kvm/tdx-stub.c
 create mode 100644 target/i386/kvm/tdx.c
 create mode 100644 target/i386/kvm/tdx.h

base-commit: 7c949c53e936aa3a658d84ab53bae5cadaa5d59c

Signature · 1 line
2.43.0