public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/12] Unify TDCALL/SEAMCALL and TDVMCALL assembly
@ 2023-08-15 11:01 Kai Huang
  2023-08-15 11:01 ` [PATCH v4 01/12] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
                   ` (13 more replies)
  0 siblings, 14 replies; 35+ messages in thread
From: Kai Huang @ 2023-08-15 11:01 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,

This series unifies the assembly code for TDCALL/SEAMCALL and TDVMCALL.
Now all of them use one singe TDX_MODULE_CALL asm macro.  More
information please see cover letter of v2 (see link below).

Tested by booting TDX guest, initializing TDX module, and running TDX
guest successfully, all with this series applied.

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

v3 -> v4:

 - Addressed Kirill's minor comments
 - Collected Reviewed-by tags from Kirill/Sathy.
 - Collected Isaku's Tested-by tag.
 - Removed unneeded header file inclusion in tdcall.S in the relevant
   two patches.
 - Rebased to latest tip/x86/tdx (v6.5-rc5).

v3: https://lore.kernel.org/lkml/20230806114131.2ilofgmxhdaa2u6b@box.shutemov.name/T/

v2 -> v3:

 - New patch (patch 12) to adjust 'struct tdx_module_args' layout to
   match KVM's "vcpu::regs[]" for VP.ENTER. (Peter)
 - Added __seamcall_saved_ret() wrapper to support VP.ENTER (merged to
   patch 10).
 - Fixed a 'noinstr' check build regression found by LKP (patch 7).
 - Rebased to latest Linus's tree (6.5-rc3 + 2 commits).

v2: https://lore.kernel.org/lkml/a23ce8fd289141cea3a1b4f3dace221dca847238.camel@intel.com/T/

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 (12):
  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: Make TDX_MODULE_CALL handle SEAMCALL #UD and #GP
  x86/virt/tdx: Adjust 'struct tdx_module_args' to use x86 "register
    index" layout

 arch/x86/Kconfig                  |  12 ++
 arch/x86/Makefile                 |   2 +
 arch/x86/boot/compressed/tdx.c    |   6 +-
 arch/x86/coco/tdx/tdcall.S        | 234 ++++--------------------------
 arch/x86/coco/tdx/tdx-shared.c    |  28 +++-
 arch/x86/coco/tdx/tdx.c           |  71 +++++----
 arch/x86/include/asm/shared/tdx.h |  92 +++++++-----
 arch/x86/include/asm/tdx.h        |  11 ++
 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  |  61 ++++++++
 arch/x86/virt/vmx/tdx/tdxcall.S   | 230 ++++++++++++++++++++++-------
 14 files changed, 435 insertions(+), 351 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: 52a93d39b17dc7eb98b6aa3edb93943248e03b2f
-- 
2.41.0


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

end of thread, other threads:[~2023-09-14  0:46 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 11:01 [PATCH v4 00/12] Unify TDCALL/SEAMCALL and TDVMCALL assembly Kai Huang
2023-08-15 11:01 ` [PATCH v4 01/12] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
2023-08-15 11:01 ` [PATCH v4 02/12] x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid Kai Huang
2023-08-25 23:25   ` kirill.shutemov
2023-08-15 11:01 ` [PATCH v4 03/12] x86/tdx: Make macros of TDCALLs consistent with the spec Kai Huang
2023-08-15 11:01 ` [PATCH v4 04/12] x86/tdx: Rename __tdx_module_call() to __tdcall() Kai Huang
2023-08-15 11:01 ` [PATCH v4 05/12] x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure Kai Huang
2023-08-25 23:28   ` kirill.shutemov
2023-08-15 11:02 ` [PATCH v4 06/12] x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs Kai Huang
2023-08-25 23:36   ` kirill.shutemov
2023-08-26  0:52     ` Huang, Kai
2023-08-15 11:02 ` [PATCH v4 07/12] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Kai Huang
2023-08-25 23:35   ` kirill.shutemov
2023-08-26  0:50     ` Huang, Kai
2023-08-26  4:59       ` Huang, Kai
2023-08-30 13:10       ` kirill.shutemov
2023-08-30 22:20         ` Huang, Kai
2023-08-15 11:02 ` [PATCH v4 08/12] x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm Kai Huang
2023-08-15 11:02 ` [PATCH v4 09/12] x86/tdx: Remove 'struct tdx_hypercall_args' Kai Huang
2023-08-15 11:02 ` [PATCH v4 10/12] x86/virt/tdx: Wire up basic SEAMCALL functions Kai Huang
2023-08-15 11:02 ` [PATCH v4 11/12] x86/virt/tdx: Make TDX_MODULE_CALL handle SEAMCALL #UD and #GP Kai Huang
2023-08-25 23:41   ` kirill.shutemov
2023-08-15 11:02 ` [PATCH v4 12/12] x86/virt/tdx: Adjust 'struct tdx_module_args' to use x86 "register index" layout Kai Huang
2023-08-25 23:44   ` kirill.shutemov
2023-08-26  0:45     ` Huang, Kai
2023-09-05 23:01 ` [PATCH v4 00/12] Unify TDCALL/SEAMCALL and TDVMCALL assembly Huang, Kai
2023-09-06 11:57   ` Peter Zijlstra
2023-09-06 12:21     ` Huang, Kai
2023-09-14  0:22   ` Isaku Yamahata
2023-09-14  0:45     ` Huang, Kai
2023-09-11 17:08 ` Paolo Bonzini
2023-09-11 22:29   ` Huang, Kai
2023-09-12  0:57     ` Huang, Kai
2023-09-12 13:37       ` Paolo Bonzini
2023-09-14  0:23         ` Isaku Yamahata

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