public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly
@ 2023-07-20 12:28 Kai Huang
  2023-07-20 12:28 ` [PATCH v2 01/11] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Kai Huang @ 2023-07-20 12:28 UTC (permalink / raw)
  To: peterz, kirill.shutemov, linux-kernel
  Cc: dave.hansen, tglx, bp, mingo, hpa, x86, seanjc, pbonzini,
	isaku.yamahata, sathyanarayanan.kuppuswamy, n.borisov.lkml,
	kai.huang

Hi Peter, Kirill, all,

This series unifies the assembly code for TDCALL/SEAMCALL and TDVMCALL.
Now all of them use one singe TDX_MODULE_CALL asm macro.

With this series, I have verified the TDX guest can boot successfully
and the TDX module can also be initialized successfully.

The last two patches are SEAMCALL patches that are needed for TDX host
patchset.  They are not mandatory to be here though, i.e., can be in the
TDX host support series.  I put them here so we can have a complete view
how TDCALL/SEAMCALL and TDVMCALL are implemented.

Could you help to review?  Thanks in advance.

(Removed KVM list -- Sean/Paolo/Isaku are still CC'ed.)

------- Histroy --------

v1 -> v2:
 - Rebased to 6.5-rc2.
 - Fixed comments from Peter and others.
 - Split patch "x86/tdx: Unify TDX_HYPERCALL and TDX_MODULE_CALL assembly"
   into three smaller patches for better review.
 - A new patch to skip saving output registers when SEAMCALL fails due to
   VMFailInvalid.  
 - Removed patch "x86/tdx: Use cmovc to save a label in TDX_MODULE_CALL asm"
 - Merged patch "x86/tdx: Move FRAME_BEGIN/END to TDX_MODULE_CALL asm macro"
   to the new patch mentioned above.

v1: https://lore.kernel.org/lkml/b95c4169-88c8-219e-87b7-6c4e058c246a@suse.com/T/


Kai Huang (11):
  x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro
  x86/tdx: Skip saving output regs when SEAMCALL fails with
    VMFailInvalid
  x86/tdx: Make macros of TDCALLs consistent with the spec
  x86/tdx: Rename __tdx_module_call() to __tdcall()
  x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure
  x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs
  x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL
  x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm
  x86/tdx: Remove 'struct tdx_hypercall_args'
  x86/virt/tdx: Wire up basic SEAMCALL functions
  x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP

 arch/x86/Kconfig                  |  12 ++
 arch/x86/Makefile                 |   2 +
 arch/x86/boot/compressed/tdx.c    |   6 +-
 arch/x86/coco/tdx/tdcall.S        | 231 ++++--------------------------
 arch/x86/coco/tdx/tdx-shared.c    |  28 +++-
 arch/x86/coco/tdx/tdx.c           |  73 +++++-----
 arch/x86/include/asm/shared/tdx.h |  83 ++++++-----
 arch/x86/include/asm/tdx.h        |  10 ++
 arch/x86/kernel/asm-offsets.c     |  33 ++---
 arch/x86/virt/Makefile            |   2 +
 arch/x86/virt/vmx/Makefile        |   2 +
 arch/x86/virt/vmx/tdx/Makefile    |   2 +
 arch/x86/virt/vmx/tdx/seamcall.S  |  42 ++++++
 arch/x86/virt/vmx/tdx/tdxcall.S   | 227 ++++++++++++++++++++++-------
 14 files changed, 406 insertions(+), 347 deletions(-)
 create mode 100644 arch/x86/virt/Makefile
 create mode 100644 arch/x86/virt/vmx/Makefile
 create mode 100644 arch/x86/virt/vmx/tdx/Makefile
 create mode 100644 arch/x86/virt/vmx/tdx/seamcall.S


base-commit: fdf0eaf11452d72945af31804e2a1048ee1b574c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-07-21 12:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-20 12:28 [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly Kai Huang
2023-07-20 12:28 ` [PATCH v2 01/11] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
2023-07-20 12:28 ` [PATCH v2 02/11] x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid Kai Huang
2023-07-20 12:28 ` [PATCH v2 03/11] x86/tdx: Make macros of TDCALLs consistent with the spec Kai Huang
2023-07-20 12:28 ` [PATCH v2 04/11] x86/tdx: Rename __tdx_module_call() to __tdcall() Kai Huang
2023-07-20 12:28 ` [PATCH v2 05/11] x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure Kai Huang
2023-07-20 12:28 ` [PATCH v2 06/11] x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs Kai Huang
2023-07-20 12:28 ` [PATCH v2 07/11] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Kai Huang
2023-07-21  5:19   ` Huang, Kai
2023-07-21  8:01     ` Peter Zijlstra
2023-07-21 11:06       ` Huang, Kai
2023-07-20 12:28 ` [PATCH v2 08/11] x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm Kai Huang
2023-07-20 12:28 ` [PATCH v2 09/11] x86/tdx: Remove 'struct tdx_hypercall_args' Kai Huang
2023-07-20 12:28 ` [PATCH v2 10/11] x86/virt/tdx: Wire up basic SEAMCALL functions Kai Huang
2023-07-20 12:28 ` [PATCH v2 11/11] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP Kai Huang
2023-07-20 13:16 ` [PATCH v2 00/11] Unify TDCALL/SEAMCALL and TDVMCALL assembly Peter Zijlstra
2023-07-21  0:18   ` Huang, Kai
2023-07-21  8:06     ` Peter Zijlstra
2023-07-21 11:02       ` Huang, Kai
2023-07-21 11:44         ` Huang, Kai
2023-07-21 12:04           ` Huang, Kai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox