Skip to content

TDX host kernel support

Kai Huang kvm lkml 15 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v15 Latest23 patches 46 repliesIn review
  2. v1423 patches 27 repliesSuperseded
  3. v1322 patches 29 repliesSuperseded
Earlier versions · 12
VersionPostedPatchesRepliesStatus
v1222 patches136 repliesSuperseded
v1120 patches153 repliesSuperseded
v1016 patches31 repliesSuperseded
v918 patches33 repliesSuperseded
v816 patches67 repliesSuperseded
v720 patches142 repliesSuperseded
v621 patches24 repliesSuperseded
v522 patches91 repliesSuperseded
v422 patches0 repliesSuperseded
v321 patches134 repliesSuperseded
v221 patches29 repliesSuperseded
v1 RFC21 patches0 repliesSuperseded

Patches in v15 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23x86/virt/tdx: Detect TDX during kernel bootarch/x86/include/asm/msr-index.h arch/x86/include/asm/tdx.h arch/x86/virt/vmx/tdx/Makefile +1 more+98 -10 replies
2/23x86/tdx: Define TDX supported page sizes as macrosarch/x86/coco/tdx/tdx-shared.c arch/x86/include/asm/shared/tdx.h+8 -30 replies
3/23x86/virt/tdx: Make INTEL_TDX_HOST depend on X86_X2APICarch/x86/Kconfig+1 -00 replies
4/23x86/cpu: Detect TDX partial write machine check erratumarch/x86/include/asm/cpufeatures.h arch/x86/kernel/cpu/intel.c+18 -00 replies
5/23x86/virt/tdx: Handle SEAMCALL no entropy error in common codearch/x86/include/asm/tdx.h+26 -04 replies
6/23x86/virt/tdx: Add SEAMCALL error printing for module initializationarch/x86/include/asm/tdx.h arch/x86/virt/vmx/tdx/tdx.c+44 -00 replies
7/23x86/virt/tdx: Add skeleton to enable TDX on demandarch/x86/include/asm/tdx.h arch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+201 -00 replies
8/23x86/virt/tdx: Use all system memory when initializing TDX module as TDX memoryarch/x86/Kconfig arch/x86/kernel/setup.c arch/x86/virt/vmx/tdx/tdx.c +1 more+174 -24 replies
9/23x86/virt/tdx: Get module global metadata for module initializationarch/x86/include/asm/shared/tdx.h arch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+114 -14 replies
10/23x86/virt/tdx: Add placeholder to construct TDMRs to cover all TDX memory regionsarch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+125 -20 replies
11/23x86/virt/tdx: Fill out TDMRs to cover all TDX memory regionsarch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+105 -10 replies
12/23x86/virt/tdx: Allocate and set up PAMTs for TDMRsarch/x86/Kconfig arch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+212 -50 replies
13/23x86/virt/tdx: Designate reserved areas for all TDMRsarch/x86/virt/vmx/tdx/tdx.c+209 -80 replies
14/23x86/virt/tdx: Configure TDX module with the TDMRs and global KeyIDarch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+45 -10 replies
15/23x86/virt/tdx: Configure global KeyID on all packagesarch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+129 -20 replies
16/23x86/virt/tdx: Initialize all TDMRsarch/x86/virt/vmx/tdx/tdx.c arch/x86/virt/vmx/tdx/tdx.h+53 -80 replies
17/23x86/kexec: Flush cache of TDX private memoryarch/x86/kernel/process.c arch/x86/kernel/reboot.c+22 -17 replies
18/23x86/virt/tdx: Keep TDMRs when module initialization is successfularch/x86/virt/vmx/tdx/tdx.c+11 -130 replies
19/23x86/virt/tdx: Improve readability of module initialization error handlingarch/x86/virt/vmx/tdx/tdx.c+35 -340 replies
20/23x86/kexec(): Reset TDX private memory on platforms with TDX erratumarch/x86/include/asm/tdx.h arch/x86/kernel/machine_kexec_64.c arch/x86/virt/vmx/tdx/tdx.c+110 -00 replies
21/23x86/virt/tdx: Handle TDX interaction with ACPI S3 and deeper statesarch/x86/virt/vmx/tdx/tdx.c+16 -01 reply
22/23x86/mce: Improve error log of kernel space TDX #MC due to erratumarch/x86/include/asm/tdx.h arch/x86/kernel/cpu/mce/core.c arch/x86/virt/vmx/tdx/tdx.c +1 more+143 -024 replies
23/23Documentation/x86: Add documentation for TDX host supportDocumentation/arch/x86/tdx.rst+211 -110 replies

Reviews trailers per patch

21 of 23 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKirill A. ShutemovIsaku YamahataDavid HildenbrandDave HansenKuppuswamy SathyanarayananNikolay BorisovHuang, YingYuan YaoRick EdgecombeTony Luck
SeriesR-b
1/23R-b R-b R-b R-b R-b
2/23R-b R-b R-b
3/23R-b R-b R-b
4/23R-b R-b R-b
5/23R-b R-b R-b R-b
6/23R-b R-b
7/23R-b R-b
8/23R-b R-b R-b R-b
9/23
10/23R-b R-b R-b
11/23R-b R-b R-b
12/23R-b R-b R-b R-b
13/23R-b R-b R-b
14/23R-b R-b R-b
15/23R-b R-b R-b
16/23R-b R-b R-b
17/23R-b R-b
18/23R-b R-b
19/23R-b R-b
20/23R-b
21/23R-b
22/23R-b R-b R-b
23/23

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

Read the v15 thread

Cover letter [PATCH v15 00/23] TDX host kernel support

Hi all,

(Again I didn't include the full cover letter here to save people's time.
The full coverletter can be found in the v13 [1]).

This version mainly addressed one issue that we (Intel people) discussed
internally: to only initialize TDX module 1.5 and later versions. The reason is TDX 1.0 has some incompatibility issues to the TDX 1.5 and later version (for detailed information please see [2]). There's no value to support TDX 1.0 when the TDX 1.5 are already out.

Hi Kirill, Dave (and all),

Could you help to review the new patch mentioned in the detailed changes below (and other minor changes due to rebase to it)?

Appreciate a lot!

The detailed changes:

(please refer to individual patch for specific changes to them.)

- v14 -> v15:
- Rebased to latest (today) master branch of Linus's tree.
- Removed the patch which uses TDH.SYS.INFO to get TDSYSINFO_STRUCT.
- Added a new patch to use TDH.SYS.RD (which is the new SEAMCALL to read TDX module metadata in TDX 1.5) to read essential metadata for module initialization and stop initializing TDX 1.0.
- Put the new patch after the patch to build the TDX-usable memory list becaues CMRs are not readed from TDX module anymore.
- Very minor rebase changes in other couple of patches due to the new TDH.SYS.RD patch.
- Addressed all comments (few) received in v14 (Rafael/Nikolay).
- Added people's tags -- thanks! (Sathy, Nickolay).

v14: https://lore.kernel.org/lkml/[email protected]/T/

[1] v13: https://lore.kernel.org/lkml/[email protected]/T/
[2] "TDX module ABI incompatibilities" spec:

    https://cdrdv2.intel.com/v1/dl/getContent/773041

Kai Huang (23):
x86/virt/tdx: Detect TDX during kernel boot
x86/tdx: Define TDX supported page sizes as macros x86/virt/tdx: Make INTEL_TDX_HOST depend on X86_X2APIC x86/cpu: Detect TDX partial write machine check erratum x86/virt/tdx: Handle SEAMCALL no entropy error in common code x86/virt/tdx: Add SEAMCALL error printing for module initialization x86/virt/tdx: Add skeleton to enable TDX on demand x86/virt/tdx: Use all system memory when initializing TDX module as
TDX memory
x86/virt/tdx: Get module global metadata for module initialization x86/virt/tdx: Add placeholder to construct TDMRs to cover all TDX
memory regions
x86/virt/tdx: Fill out TDMRs to cover all TDX memory regions x86/virt/tdx: Allocate and set up PAMTs for TDMRs x86/virt/tdx: Designate reserved areas for all TDMRs x86/virt/tdx: Configure TDX module with the TDMRs and global KeyID x86/virt/tdx: Configure global KeyID on all packages x86/virt/tdx: Initialize all TDMRs
x86/kexec: Flush cache of TDX private memory x86/virt/tdx: Keep TDMRs when module initialization is successful x86/virt/tdx: Improve readability of module initialization error
handling
x86/kexec(): Reset TDX private memory on platforms with TDX erratum x86/virt/tdx: Handle TDX interaction with ACPI S3 and deeper states x86/mce: Improve error log of kernel space TDX #MC due to erratum Documentation/x86: Add documentation for TDX host support

 Documentation/arch/x86/tdx.rst     |  222 +++-
 arch/x86/Kconfig                   |    3 +
 arch/x86/coco/tdx/tdx-shared.c     |    6 +-
 arch/x86/include/asm/cpufeatures.h |    1 +
 arch/x86/include/asm/msr-index.h   |    3 +
 arch/x86/include/asm/shared/tdx.h  |    6 +
 arch/x86/include/asm/tdx.h         |   39 +
 arch/x86/kernel/cpu/intel.c        |   17 +
 arch/x86/kernel/cpu/mce/core.c     |   33 +
 arch/x86/kernel/machine_kexec_64.c |   16 +
 arch/x86/kernel/process.c          |    8 +-
 arch/x86/kernel/reboot.c           |   15 +
 arch/x86/kernel/setup.c            |    2 +
 arch/x86/virt/vmx/tdx/Makefile     |    2 +-
 arch/x86/virt/vmx/tdx/tdx.c        | 1555 ++++++++++++++++++++++++++++
 arch/x86/virt/vmx/tdx/tdx.h        |  121 +++
 16 files changed, 2033 insertions(+), 16 deletions(-)
 create mode 100644 arch/x86/virt/vmx/tdx/tdx.c
 create mode 100644 arch/x86/virt/vmx/tdx/tdx.h

base-commit: 6bc986ab839c844e78a2333a02e55f02c9e57935

Signature · 1 line
2.41.0