Skip to content

KVM: VMX: Initialize TDX when loading KVM module

Kai Huang kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v13 patches 15 repliesSuperseded

Changes in v2 from the cover letter

- Add KVM_INTEL_TDX to guide KVM TDX code. (Sean)
- Distinguish "TDX cannot be supported" vs "TDX fail to enable due to unexpected failure", and handle them differently. (Sean)
- Update changelog accordingly
- Remove useless comments around tdx_enable() and tdx_cpu_enable() (Sean).
- Add SPDX-License-Identifier tag to vmx/tdx.h

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: VMX: Refactor VMX module init/exit functionsarch/x86/kvm/vmx/main.c arch/x86/kvm/vmx/vmx.c arch/x86/kvm/vmx/vmx.h+37 -210 replies
2/3KVM: Export hardware virtualization enabling/disabling functionsinclude/linux/kvm_host.h virt/kvm/kvm_main.c+12 -140 replies
3/3KVM: VMX: Initialize TDX during KVM module loadarch/x86/kvm/Kconfig arch/x86/kvm/Makefile arch/x86/kvm/vmx/main.c +2 more+186 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] KVM: VMX: Initialize TDX when loading KVM module

Hi Paolo/Sean,

This series contains patches to initialize TDX when loading KVM module. The main purpose of sending this out is to have a review and for the integration to kvm-coco-queue, but this series can also be applied to kvm/queue cleanly.

v1 -> v2:
- Add KVM_INTEL_TDX to guide KVM TDX code. (Sean)
- Distinguish "TDX cannot be supported" vs "TDX fail to enable due to unexpected failure", and handle them differently. (Sean)
- Update changelog accordingly
- Remove useless comments around tdx_enable() and tdx_cpu_enable() (Sean).
- Add SPDX-License-Identifier tag to vmx/tdx.h

Btw:

I kept the name tdx_bringup(), tdx_cleanup() but didn't change them to tdx_module_init() and tdx_module_exit() cause I feel KVM does more than "module" init/exit. We can change that if needed.

v1: https://lore.kernel.org/kvm/[email protected]/T/

Kai Huang (3):
KVM: VMX: Refactor VMX module init/exit functions
KVM: Export hardware virtualization enabling/disabling functions
KVM: VMX: Initialize TDX during KVM module load

 arch/x86/kvm/Kconfig     |  10 +++
 arch/x86/kvm/Makefile    |   1 +
 arch/x86/kvm/vmx/main.c  |  41 +++++++++++
 arch/x86/kvm/vmx/tdx.c   | 153 +++++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/vmx/tdx.h   |  13 ++++
 arch/x86/kvm/vmx/vmx.c   |  23 +-----
 arch/x86/kvm/vmx/vmx.h   |   3 +
 include/linux/kvm_host.h |   8 ++
 virt/kvm/kvm_main.c      |  18 +----
 9 files changed, 235 insertions(+), 35 deletions(-)
 create mode 100644 arch/x86/kvm/vmx/tdx.c
 create mode 100644 arch/x86/kvm/vmx/tdx.h

base-commit: b1e0320c5a9fe875f56039ea43e183c59974d38a

Signature · 1 line
2.46.2