From: Rick Edgecombe <rick.p.edgecombe@intel.com>
To: pbonzini@redhat.com, seanjc@google.com
Cc: rick.p.edgecombe@intel.com, yan.y.zhao@intel.com,
isaku.yamahata@gmail.com, kai.huang@intel.com,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
tony.lindgren@linux.intel.com, xiaoyao.li@intel.com,
reinette.chatre@intel.com
Subject: [PATCH v2 00/25] TDX vCPU/VM creation
Date: Wed, 30 Oct 2024 12:00:13 -0700 [thread overview]
Message-ID: <20241030190039.77971-1-rick.p.edgecombe@intel.com> (raw)
Hi,
Here is v2 of TDX VM/vCPU creation series. As discussed earlier, non-nits
from v1[0] have been applied and it’s ready to hand off to Paolo. A few
items remain that may be worth further discussion:
- Disable CET/PT in tdx_get_supported_xfam(), as these features haven’t
been been tested.
- The Retry loop around tdh_phymem_page_reclaim() in “KVM: TDX:
create/destroy VM structure” likely can be dropped.
- Drop support for TDX Module’s that don’t support
MD_FIELD_ID_FEATURES0_TOPOLOGY_ENUM. [1]
- Type-safety in to_vmx()/to_tdx(). [2]
This series has 9 commits intended to collect acks from x86 maintainers.
The first group of commits is for reading TDX static metadata for KVM to
use:
x86/virt/tdx: Share the global metadata structure for KVM to use
x86/virt/tdx: Read essential global metadata for KVM
The second group is for exporting a TDX keyid allocator for KVM to use:
x86/virt/tdx: Add tdx_guest_keyid_alloc/free() to alloc and free
TDX guest KeyID
The third group is for exporting various SEAMCALLs needed by KVM for this
series. SEAMCALL patches for the later TDX sections will come with those
series’:
x86/virt/tdx: Add SEAMCALL wrappers for TDX KeyID management
x86/virt/tdx: Add SEAMCALL wrappers for TDX TD creation
x86/virt/tdx: Add SEAMCALL wrappers for TDX vCPU creation
x86/virt/tdx: Add SEAMCALL wrappers for TDX page cache management
x86/virt/tdx: Add SEAMCALL wrappers for TDX VM/vCPU field access
x86/virt/tdx: Add SEAMCALL wrappers for TDX flush operations
This series is based off of a kvm-coco-queue commit and some pre-req
series:
1. d659088d46df "KVM: x86/mmu: Prevent aliased memslot GFNs" (in
kvm-coco-queue).
2. v6 of “TDX host: metadata reading tweaks, bug fix and info dump”
3. “KVM: VMX: Initialize TDX when loading KVM module” re-ordered from
the commits in kvm-coco-queue
It requires TDX module 1.5.06.00.0744[3], or later. This is due to removal
of the workarounds for the lack of NO_RBP_MOD. Now NO_RBP_MOD is enabled,
and this particular version of the TDX module has a NO_RBP_MOD related bug
fix.
The full KVM branch is here:
https://github.com/intel/tdx/tree/tdx_kvm_dev-2024-10-30
Matching QEMU:
https://github.com/intel-staging/qemu-tdx/tree/tdx-qemu-wip-2024-10-11
[0] https://lore.kernel.org/kvm/20240812224820.34826-1-rick.p.edgecombe@intel.com/
[1] https://lore.kernel.org/kvm/d71540ab13e728d1326baae92e8ea82d00c08abe.camel@intel.com/
[2] https://lore.kernel.org/kvm/89657f96-0ed1-4543-9074-f13f62cc4694@redhat.com/
[3] https://github.com/intel/tdx-module/releases/tag/TDX_1.5.06
Isaku Yamahata (19):
x86/virt/tdx: Add tdx_guest_keyid_alloc/free() to alloc and free TDX
guest KeyID
x86/virt/tdx: Add SEAMCALL wrappers for TDX KeyID management
x86/virt/tdx: Add SEAMCALL wrappers for TDX TD creation
x86/virt/tdx: Add SEAMCALL wrappers for TDX vCPU creation
x86/virt/tdx: Add SEAMCALL wrappers for TDX page cache management
x86/virt/tdx: Add SEAMCALL wrappers for TDX VM/vCPU field access
x86/virt/tdx: Add SEAMCALL wrappers for TDX flush operations
KVM: TDX: Add placeholders for TDX VM/vCPU structures
KVM: TDX: Define TDX architectural definitions
KVM: TDX: Add helper functions to print TDX SEAMCALL error
KVM: TDX: Add place holder for TDX VM specific mem_enc_op ioctl
KVM: TDX: Get system-wide info about TDX module on initialization
KVM: TDX: create/destroy VM structure
KVM: TDX: Support per-VM KVM_CAP_MAX_VCPUS extension check
KVM: TDX: initialize VM with TDX specific parameters
KVM: TDX: Make pmu_intel.c ignore guest TD case
KVM: TDX: Don't offline the last cpu of one package when there's TDX
guest
KVM: TDX: create/free TDX vcpu structure
KVM: TDX: Do TDX specific vcpu initialization
Kai Huang (3):
x86/virt/tdx: Share the global metadata structure for KVM to use
KVM: TDX: Get TDX global information
x86/virt/tdx: Read essential global metadata for KVM
Sean Christopherson (1):
KVM: TDX: Add TDX "architectural" error codes
Xiaoyao Li (2):
KVM: x86: Introduce KVM_TDX_GET_CPUID
KVM: x86/mmu: Taking guest pa into consideration when calculate tdp
level
arch/x86/include/asm/kvm-x86-ops.h | 4 +-
arch/x86/include/asm/kvm_host.h | 2 +
arch/x86/include/asm/shared/tdx.h | 7 +-
arch/x86/include/asm/tdx.h | 25 +
.../tdx => include/asm}/tdx_global_metadata.h | 19 +
arch/x86/include/uapi/asm/kvm.h | 59 +
arch/x86/kvm/Kconfig | 2 +
arch/x86/kvm/cpuid.c | 21 +
arch/x86/kvm/cpuid.h | 3 +
arch/x86/kvm/mmu/mmu.c | 9 +-
arch/x86/kvm/vmx/main.c | 143 +-
arch/x86/kvm/vmx/pmu_intel.c | 50 +-
arch/x86/kvm/vmx/pmu_intel.h | 28 +
arch/x86/kvm/vmx/tdx.c | 1369 ++++++++++++++++-
arch/x86/kvm/vmx/tdx.h | 92 ++
arch/x86/kvm/vmx/tdx_arch.h | 165 ++
arch/x86/kvm/vmx/tdx_errno.h | 37 +
arch/x86/kvm/vmx/vmx.h | 34 +-
arch/x86/kvm/vmx/x86_ops.h | 24 +
arch/x86/kvm/x86.c | 15 +-
arch/x86/virt/vmx/tdx/tdx.c | 264 +++-
arch/x86/virt/vmx/tdx/tdx.h | 39 +-
arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 46 +
23 files changed, 2391 insertions(+), 66 deletions(-)
rename arch/x86/{virt/vmx/tdx => include/asm}/tdx_global_metadata.h (68%)
create mode 100644 arch/x86/kvm/vmx/pmu_intel.h
create mode 100644 arch/x86/kvm/vmx/tdx_arch.h
create mode 100644 arch/x86/kvm/vmx/tdx_errno.h
--
2.47.0
next reply other threads:[~2024-10-30 19:00 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 19:00 Rick Edgecombe [this message]
2024-10-30 19:00 ` [PATCH v2 01/25] x86/virt/tdx: Share the global metadata structure for KVM to use Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 02/25] KVM: TDX: Get TDX global information Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 03/25] x86/virt/tdx: Read essential global metadata for KVM Rick Edgecombe
2024-12-06 8:37 ` Xiaoyao Li
2024-12-06 16:13 ` Huang, Kai
2024-12-06 16:18 ` Huang, Kai
2024-12-06 16:24 ` Dave Hansen
2024-12-07 0:00 ` Huang, Kai
2024-12-12 0:31 ` Edgecombe, Rick P
2024-12-21 1:17 ` Huang, Kai
2024-12-21 1:07 ` [PATCH v2.1 " Kai Huang
2024-10-30 19:00 ` [PATCH v2 04/25] x86/virt/tdx: Add tdx_guest_keyid_alloc/free() to alloc and free TDX guest KeyID Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 05/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX KeyID management Rick Edgecombe
2024-11-12 20:09 ` Dave Hansen
2024-11-14 0:01 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 06/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX TD creation Rick Edgecombe
2024-11-12 20:17 ` Dave Hansen
2024-11-12 21:21 ` Edgecombe, Rick P
2024-11-12 21:40 ` Dave Hansen
2024-10-30 19:00 ` [PATCH v2 07/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX vCPU creation Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 08/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX page cache management Rick Edgecombe
2024-10-31 3:57 ` Yan Zhao
2024-10-31 18:57 ` Edgecombe, Rick P
2024-10-31 23:33 ` Huang, Kai
2024-11-13 0:20 ` Dave Hansen
2024-11-13 20:51 ` Edgecombe, Rick P
2024-11-13 21:08 ` Dave Hansen
2024-11-13 21:25 ` Huang, Kai
2024-11-13 22:01 ` Edgecombe, Rick P
2024-11-13 21:44 ` Edgecombe, Rick P
2024-11-13 21:50 ` Dave Hansen
2024-11-13 22:00 ` Edgecombe, Rick P
2024-11-14 0:21 ` Huang, Kai
2024-11-14 0:32 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 09/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX VM/vCPU field access Rick Edgecombe
2025-01-05 9:45 ` Francesco Lavra
2025-01-06 18:59 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 10/25] x86/virt/tdx: Add SEAMCALL wrappers for TDX flush operations Rick Edgecombe
2024-11-13 1:11 ` Dave Hansen
2024-11-13 21:18 ` Edgecombe, Rick P
2024-11-13 21:41 ` Dave Hansen
2024-11-13 21:48 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 11/25] KVM: TDX: Add placeholders for TDX VM/vCPU structures Rick Edgecombe
2025-01-05 10:58 ` Francesco Lavra
2025-01-06 19:00 ` Edgecombe, Rick P
2025-01-22 7:52 ` Tony Lindgren
2024-10-30 19:00 ` [PATCH v2 12/25] KVM: TDX: Define TDX architectural definitions Rick Edgecombe
2024-10-30 22:38 ` Huang, Kai
2024-10-30 22:53 ` Huang, Kai
2024-10-30 19:00 ` [PATCH v2 13/25] KVM: TDX: Add TDX "architectural" error codes Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 14/25] KVM: TDX: Add helper functions to print TDX SEAMCALL error Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 15/25] KVM: TDX: Add place holder for TDX VM specific mem_enc_op ioctl Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 16/25] KVM: TDX: Get system-wide info about TDX module on initialization Rick Edgecombe
2024-10-31 9:09 ` Binbin Wu
2024-10-31 9:18 ` Tony Lindgren
2024-10-31 9:22 ` Binbin Wu
2024-10-31 9:23 ` Xiaoyao Li
2024-10-31 9:37 ` Tony Lindgren
2024-10-31 14:27 ` Xiaoyao Li
2024-11-01 8:19 ` Tony Lindgren
2024-12-06 8:45 ` Xiaoyao Li
2024-12-10 9:35 ` Tony Lindgren
2025-01-08 2:34 ` Chao Gao
2025-01-08 5:41 ` Huang, Kai
2024-10-30 19:00 ` [PATCH v2 17/25] KVM: TDX: create/destroy VM structure Rick Edgecombe
2024-11-04 2:03 ` Chao Gao
2024-11-04 5:59 ` Tony Lindgren
2024-10-30 19:00 ` [PATCH v2 18/25] KVM: TDX: Support per-VM KVM_CAP_MAX_VCPUS extension check Rick Edgecombe
2025-01-05 22:12 ` Huang, Kai
2025-01-06 19:09 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 19/25] KVM: TDX: initialize VM with TDX specific parameters Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 20/25] KVM: TDX: Make pmu_intel.c ignore guest TD case Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 21/25] KVM: TDX: Don't offline the last cpu of one package when there's TDX guest Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 22/25] KVM: TDX: create/free TDX vcpu structure Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 23/25] KVM: TDX: Do TDX specific vcpu initialization Rick Edgecombe
2024-10-30 19:00 ` [PATCH v2 24/25] KVM: x86: Introduce KVM_TDX_GET_CPUID Rick Edgecombe
2024-11-01 6:39 ` Binbin Wu
2024-11-01 16:03 ` Edgecombe, Rick P
2025-01-09 11:07 ` Francesco Lavra
2025-01-10 4:29 ` Xiaoyao Li
2025-01-10 10:34 ` Francesco Lavra
2025-01-10 4:47 ` Xiaoyao Li
2025-01-21 20:24 ` Edgecombe, Rick P
2025-01-22 7:43 ` Xiaoyao Li
2025-01-23 19:44 ` Edgecombe, Rick P
2025-01-21 23:19 ` Edgecombe, Rick P
2024-10-30 19:00 ` [PATCH v2 25/25] KVM: x86/mmu: Taking guest pa into consideration when calculate tdp level Rick Edgecombe
2024-10-31 19:21 ` [PATCH v2 00/25] TDX vCPU/VM creation Adrian Hunter
2024-11-11 9:49 ` Tony Lindgren
2024-11-12 7:26 ` Adrian Hunter
2024-11-12 9:57 ` Tony Lindgren
2024-11-12 21:26 ` Edgecombe, Rick P
2024-12-10 18:22 ` Paolo Bonzini
2024-12-23 16:25 ` Paolo Bonzini
2025-01-04 1:43 ` Edgecombe, Rick P
2025-01-05 21:32 ` Huang, Kai
2025-01-07 7:37 ` Tony Lindgren
2025-01-07 12:41 ` Nikolay Borisov
2025-01-08 5:28 ` Tony Lindgren
2025-01-08 15:01 ` Sean Christopherson
2025-01-09 7:04 ` Tony Lindgren
2025-01-22 8:27 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241030190039.77971-1-rick.p.edgecombe@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=isaku.yamahata@gmail.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=seanjc@google.com \
--cc=tony.lindgren@linux.intel.com \
--cc=xiaoyao.li@intel.com \
--cc=yan.y.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®