All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Huang <kai.huang@intel.com>
To: peterz@infradead.org, kirill.shutemov@linux.intel.com,
	linux-kernel@vger.kernel.org
Cc: dave.hansen@intel.com, tglx@linutronix.de, bp@alien8.de,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	seanjc@google.com, pbonzini@redhat.com, isaku.yamahata@intel.com,
	sathyanarayanan.kuppuswamy@linux.intel.com,
	n.borisov.lkml@gmail.com, kai.huang@intel.com
Subject: [PATCH v3 00/12] Unify TDCALL/SEAMCALL and TDVMCALL assembly
Date: Wed, 26 Jul 2023 23:25:02 +1200	[thread overview]
Message-ID: <cover.1690369495.git.kai.huang@intel.com> (raw)

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.  More
information please see cover letter of v2 (see link below).

This version mainly addressed Peter's comment to add patch to adjust
'struct tdx_module_args' to match KVM's "vcpu::regs".

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

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

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: Allow SEAMCALL to handle #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        | 231 ++++--------------------------
 arch/x86/coco/tdx/tdx-shared.c    |  28 +++-
 arch/x86/coco/tdx/tdx.c           |  69 +++++----
 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   | 227 ++++++++++++++++++++++-------
 14 files changed, 433 insertions(+), 345 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: 18b44bc5a67275641fb26f2c54ba7eef80ac5950
-- 
2.41.0


             reply	other threads:[~2023-07-26 11:25 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 11:25 Kai Huang [this message]
2023-07-26 11:25 ` [PATCH v3 01/12] x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro Kai Huang
2023-07-27 12:48   ` kirill.shutemov
2023-07-26 11:25 ` [PATCH v3 02/12] x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid Kai Huang
2023-07-27 12:52   ` kirill.shutemov
2023-07-27 22:55     ` Huang, Kai
2023-07-26 11:25 ` [PATCH v3 03/12] x86/tdx: Make macros of TDCALLs consistent with the spec Kai Huang
2023-07-27 13:00   ` kirill.shutemov
2023-07-28  1:54   ` Sathyanarayanan Kuppuswamy
2023-07-28  2:45     ` Huang, Kai
2023-07-26 11:25 ` [PATCH v3 04/12] x86/tdx: Rename __tdx_module_call() to __tdcall() Kai Huang
2023-07-27 13:02   ` kirill.shutemov
2023-07-28 15:33   ` Sathyanarayanan Kuppuswamy
2023-07-26 11:25 ` [PATCH v3 05/12] x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure Kai Huang
2023-07-27 16:36   ` kirill.shutemov
2023-07-27 22:54     ` Huang, Kai
2023-08-03 10:58       ` kirill.shutemov
2023-08-03 11:35         ` Huang, Kai
2023-08-03 11:47           ` kirill.shutemov
2023-07-26 11:25 ` [PATCH v3 06/12] x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs Kai Huang
2023-07-27 16:50   ` kirill.shutemov
2023-07-27 22:58     ` Huang, Kai
2023-07-26 11:25 ` [PATCH v3 07/12] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Kai Huang
2023-07-27 17:10   ` kirill.shutemov
2023-07-27 23:05     ` Huang, Kai
2023-08-03 11:45       ` kirill.shutemov
2023-08-03 11:56         ` Huang, Kai
2023-08-03 12:12           ` kirill.shutemov
2023-08-03 12:41             ` Huang, Kai
2023-08-03 13:47               ` kirill.shutemov
2023-08-03 22:41                 ` Huang, Kai
2023-07-26 11:25 ` [PATCH v3 08/12] x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm Kai Huang
2023-08-06 11:25   ` kirill.shutemov
2023-07-26 11:25 ` [PATCH v3 09/12] x86/tdx: Remove 'struct tdx_hypercall_args' Kai Huang
2023-08-06 11:29   ` kirill.shutemov
2023-07-26 11:25 ` [PATCH v3 10/12] x86/virt/tdx: Wire up basic SEAMCALL functions Kai Huang
2023-08-06 11:36   ` kirill.shutemov
2023-08-07  1:40     ` Huang, Kai
2023-08-07 14:30       ` Sean Christopherson
2023-08-07 23:51         ` Huang, Kai
2023-07-26 11:25 ` [PATCH v3 11/12] x86/virt/tdx: Allow SEAMCALL to handle #UD and #GP Kai Huang
2023-08-06 11:41   ` kirill.shutemov
2023-08-07  2:14     ` Huang, Kai
2023-08-07  9:53       ` kirill.shutemov
2023-08-07 12:41         ` Huang, Kai
2023-08-07 14:27           ` kirill.shutemov
2023-08-07 14:46     ` Dave Hansen
2023-07-26 11:25 ` [PATCH v3 12/12] x86/virt/tdx: Adjust 'struct tdx_module_args' to use x86 "register index" layout Kai Huang
2023-08-02 21:32   ` Isaku Yamahata
2023-08-02 23:20     ` Huang, Kai
2023-08-02 21:39   ` Isaku Yamahata
2023-08-06 11:50   ` kirill.shutemov
2023-08-07  2:16     ` Huang, Kai

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=cover.1690369495.git.kai.huang@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=hpa@zytor.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=n.borisov.lkml@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.