Skip to content

KVM: x86: TDX preparation of introducing vm_type and blocking ioctls based on vm_type

Xiaoyao Li kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11KVM: x86: Introduce vm_type to differentiate normal VMs from confidential VMsDocumentation/virt/kvm/api.rst arch/x86/include/asm/kvm-x86-ops.h arch/x86/include/asm/kvm_host.h +7 more+46 -12 replies
2/11KVM: x86: Disable direct IRQ injection for TDXarch/x86/kvm/x86.c arch/x86/kvm/x86.h+7 -10 replies
3/11KVM: x86: Clean up kvm_vcpu_ioctl_x86_setup_mce()arch/x86/kvm/x86.c+5 -71 reply
4/11KVM: x86: Disable MCE related stuff for TDXarch/x86/kvm/x86.c arch/x86/kvm/x86.h+15 -02 replies
5/11KVM: x86: Disallow tsc manipulation for TDXarch/x86/kvm/x86.c arch/x86/kvm/x86.h+31 -80 replies
6/11KVM: x86: Disable in-kernel I/O APIC and level routes for TDXarch/x86/kvm/ioapic.c arch/x86/kvm/irq_comm.c arch/x86/kvm/lapic.c +2 more+25 -30 replies
7/11KVM: x86: Disable SMM for TDXarch/x86/kvm/irq_comm.c arch/x86/kvm/x86.c arch/x86/kvm/x86.h+13 -03 replies
8/11KVM: x86: Disable INIT/SIPI for TDXarch/x86/kvm/irq_comm.c arch/x86/kvm/x86.h+7 -00 replies
9/11KVM: x86: Block ioctls to access guest state for TDXarch/x86/kvm/x86.c arch/x86/kvm/x86.h+93 -170 replies
10/11KVM: Disallow read-only memory for x86 TDXarch/x86/kvm/x86.c include/linux/kvm_host.h virt/kvm/kvm_main.c+23 -62 replies
11/11KVM: Disallow dirty logging for x86 TDXarch/x86/kvm/x86.c include/linux/kvm_host.h virt/kvm/kvm_main.c+15 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/11] KVM: x86: TDX preparation of introducing vm_type and blocking ioctls based on vm_type

This patchset is split from the TDX series[1].

It introduces vm_type for x86 at Patch 1, which leaves vaule 0 for normal VM and adds a new type KVM_X86_TDX_VM for upcoming TDX guest. Following patches (2, 4 - 11) block the ioctls that doesn't support for TDX from userspace for TDX by checking the VM type.

Patch 3 is a cleanup.

Note, it doesn't block the ioctls for SEV-ES at all because I'm not sure if each one applied to SEV-ES or not. Folks can introduce new vm_type for SEV-* and extend each helper function kvm_xxx_feature_disallowed() for SEV-* vm type.

Paolo,

Please let us know if you want this series sent together with whole TDX support.

[1] https://lore.kernel.org/all/[email protected]/T/#u

Isaku Yamahata (1):
KVM: Disallow read-only memory for x86 TDX

Kai Huang (1):
KVM: x86: Disable in-kernel I/O APIC and level routes for TDX

Sean Christopherson (6):
KVM: x86: Introduce vm_type to differentiate normal VMs from
confidential VMs
KVM: x86: Disable direct IRQ injection for TDX
KVM: x86: Disable MCE related stuff for TDX
KVM: x86: Disallow tsc manipulation for TDX
KVM: x86: Block ioctls to access guest state for TDX
KVM: Disallow dirty logging for x86 TDX

Xiaoyao Li (3):
KVM: x86: Clean up kvm_vcpu_ioctl_x86_setup_mce()
KVM: x86: Disable SMM for TDX
KVM: x86: Disable INIT/SIPI for TDX

 Documentation/virt/kvm/api.rst        |  15 ++
 arch/x86/include/asm/kvm-x86-ops.h    |   1 +
 arch/x86/include/asm/kvm_host.h       |   2 +
 arch/x86/include/uapi/asm/kvm.h       |   3 +
 arch/x86/kvm/ioapic.c                 |   5 +
 arch/x86/kvm/irq_comm.c               |  13 +-
 arch/x86/kvm/lapic.c                  |   3 +-
 arch/x86/kvm/svm/svm.c                |   6 +
 arch/x86/kvm/vmx/vmx.c                |   6 +
 arch/x86/kvm/x86.c                    | 199 +++++++++++++++++++++-----
 arch/x86/kvm/x86.h                    |  35 +++++
 include/linux/kvm_host.h              |   2 +
 include/uapi/linux/kvm.h              |   1 +
 tools/arch/x86/include/uapi/asm/kvm.h |   3 +
 tools/include/uapi/linux/kvm.h        |   1 +
 virt/kvm/kvm_main.c                   |  25 +++-
 16 files changed, 278 insertions(+), 42 deletions(-)
Signature · 1 line
2.27.0