linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan  <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, Shuah Khan <shuah@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: "H . Peter Anvin" <hpa@zytor.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kuppuswamy Sathyanarayanan 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	Tony Luck <tony.luck@intel.com>, Kai Huang <kai.huang@intel.com>,
	Wander Lairson Costa <wander@redhat.com>,
	Isaku Yamahata <isaku.yamahata@gmail.com>,
	marcelo.cerri@canonical.com, tim.gardner@canonical.com,
	khalid.elmously@canonical.com, philip.cox@canonical.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: [PATCH v14 1/3] x86/tdx: Make __tdx_module_call() usable in driver module
Date: Wed, 28 Sep 2022 14:55:33 -0700	[thread overview]
Message-ID: <20220928215535.26527-2-sathyanarayanan.kuppuswamy@linux.intel.com> (raw)
In-Reply-To: <20220928215535.26527-1-sathyanarayanan.kuppuswamy@linux.intel.com>

To support TDX attestation, the TDX guest user interface driver must
use the __tdx module_call() function in the driver to allow the user to
obtain the TDREPORT.

So export the __tdx_module_call() and move the TDX Module IDs to
asm/tdx.h.

This is a preparatory patch for adding attestation support.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---

Changes since v13:
 * None

 arch/x86/coco/tdx/tdcall.S | 2 ++
 arch/x86/coco/tdx/tdx.c    | 5 -----
 arch/x86/include/asm/tdx.h | 5 +++++
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/coco/tdx/tdcall.S b/arch/x86/coco/tdx/tdcall.S
index f9eb1134f22d..47a1534946c8 100644
--- a/arch/x86/coco/tdx/tdcall.S
+++ b/arch/x86/coco/tdx/tdcall.S
@@ -3,6 +3,7 @@
 #include <asm/asm.h>
 #include <asm/frame.h>
 #include <asm/unwind_hints.h>
+#include <asm/export.h>
 
 #include <linux/linkage.h>
 #include <linux/bits.h>
@@ -75,6 +76,7 @@ SYM_FUNC_START(__tdx_module_call)
 	FRAME_END
 	RET
 SYM_FUNC_END(__tdx_module_call)
+EXPORT_SYMBOL_GPL(__tdx_module_call);
 
 /*
  * __tdx_hypercall() - Make hypercalls to a TDX VMM using TDVMCALL leaf
diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
index 928dcf7a20d9..2dcc6021aa43 100644
--- a/arch/x86/coco/tdx/tdx.c
+++ b/arch/x86/coco/tdx/tdx.c
@@ -12,11 +12,6 @@
 #include <asm/insn-eval.h>
 #include <asm/pgtable.h>
 
-/* TDX module Call Leaf IDs */
-#define TDX_GET_INFO			1
-#define TDX_GET_VEINFO			3
-#define TDX_ACCEPT_PAGE			6
-
 /* TDX hypercall Leaf IDs */
 #define TDVMCALL_MAP_GPA		0x10001
 
diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
index 020c81a7c729..34c00d8a5263 100644
--- a/arch/x86/include/asm/tdx.h
+++ b/arch/x86/include/asm/tdx.h
@@ -18,6 +18,11 @@
 #define TDX_SW_ERROR			(TDX_ERROR | GENMASK_ULL(47, 40))
 #define TDX_SEAMCALL_VMFAILINVALID	(TDX_SW_ERROR | _UL(0xFFFF0000))
 
+/* TDX module Call Leaf IDs */
+#define TDX_GET_INFO			1
+#define TDX_GET_VEINFO			3
+#define TDX_ACCEPT_PAGE			6
+
 #ifndef __ASSEMBLY__
 
 /*
-- 
2.34.1


  reply	other threads:[~2022-09-28 21:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 21:55 [PATCH v14 0/3] Add TDX Guest Attestation support Kuppuswamy Sathyanarayanan
2022-09-28 21:55 ` Kuppuswamy Sathyanarayanan [this message]
2022-10-12 10:18   ` [PATCH v14 1/3] x86/tdx: Make __tdx_module_call() usable in driver module Borislav Petkov
2022-10-12 13:35     ` Sathyanarayanan Kuppuswamy
2022-10-12 14:27       ` Borislav Petkov
2022-10-12 15:44         ` Sathyanarayanan Kuppuswamy
2022-10-12 16:23           ` Greg Kroah-Hartman
2022-10-12 17:13             ` Sathyanarayanan Kuppuswamy
2022-10-12 17:26               ` Greg Kroah-Hartman
2022-10-12 18:11                 ` Sathyanarayanan Kuppuswamy
2022-09-28 21:55 ` [PATCH v14 2/3] virt: Add TDX guest driver Kuppuswamy Sathyanarayanan
2022-09-29 18:02   ` Wander Lairson Costa
2022-09-29 18:11     ` Sathyanarayanan Kuppuswamy
2022-09-30 12:22       ` Greg Kroah-Hartman
2022-09-30 15:27         ` Sathyanarayanan Kuppuswamy
2022-10-12 15:47   ` Borislav Petkov
2022-10-12 23:01     ` Sathyanarayanan Kuppuswamy
2022-10-13 13:21       ` Borislav Petkov
2022-09-28 21:55 ` [PATCH v14 3/3] selftests: tdx: Test TDX attestation GetReport support Kuppuswamy Sathyanarayanan

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=20220928215535.26527-2-sathyanarayanan.kuppuswamy@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=isaku.yamahata@gmail.com \
    --cc=kai.huang@intel.com \
    --cc=khalid.elmously@canonical.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=marcelo.cerri@canonical.com \
    --cc=mingo@redhat.com \
    --cc=philip.cox@canonical.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim.gardner@canonical.com \
    --cc=tony.luck@intel.com \
    --cc=wander@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).