From: Dave Hansen <dave.hansen@intel.com>
To: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
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>,
"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: Re: [PATCH v17 1/3] x86/tdx: Add a wrapper to get TDREPORT from the TDX Module
Date: Fri, 11 Nov 2022 10:35:54 -0800 [thread overview]
Message-ID: <115a87d7-144a-2828-8e4f-9c1f156b73ae@intel.com> (raw)
In-Reply-To: <20221104032355.227814-2-sathyanarayanan.kuppuswamy@linux.intel.com>
On 11/3/22 20:23, Kuppuswamy Sathyanarayanan wrote:
> To support TDX attestation, the TDX guest driver exposes an IOCTL
> interface to allow userspace to get the TDREPORT from the TDX module
> via TDG.MR.TDREPORT TDCALL.
This all acts and is named like this is *THE* way to do a TD report.
This is the only type of TD report.
Is it?
If so, why is there a subtype in the TDX module ABI? It's easy to miss
in the kernel code, btw:
> +int tdx_mcall_get_report(u8 *reportdata, u8 *tdreport)
> +{
> + u64 ret;
> +
> + ret = __tdx_module_call(TDX_GET_REPORT, virt_to_phys(tdreport),
> + virt_to_phys(reportdata), 0, 0, NULL);
subtype here ^
mixed in next to another magic 0.
> + if (ret) {
> + if (TDCALL_RETURN_CODE(ret) == TDCALL_INVALID_OPERAND)
> + return -EINVAL;
> + return -EIO;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(tdx_mcall_get_report);
What happens to this interface when subtype 1 is added?
TDX_CMD_GET_REPORT can only get subtype 0. So, we'll have, what, a new
ioctl()? TDX_CMD_GET_REPORT_SUBTYPE1?
This is why I was pushing for a more generic ABI that would actually
work for more than one subtype. Other folks thought that was a bad
idea. I can live with that. But, what I can't live with is just
pretending that this is the one and only forever "tdreport" interface.
This is *NOT* "a wrapper to get TDREPORT from the TDX Module", this is
at best "a wrapper to get TDREPORT sub type 0 from the TDX Module".
It also occurs to me that "sub type 0" could use an actual name. Could
we give it one, please?
next prev parent reply other threads:[~2022-11-11 18:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 3:23 [PATCH v17 0/3] Add TDX Guest Attestation support Kuppuswamy Sathyanarayanan
2022-11-04 3:23 ` [PATCH v17 1/3] x86/tdx: Add a wrapper to get TDREPORT from the TDX Module Kuppuswamy Sathyanarayanan
2022-11-10 15:16 ` Wander Lairson Costa
2022-11-11 18:35 ` Dave Hansen [this message]
2022-11-15 0:33 ` Sathyanarayanan Kuppuswamy
2022-11-15 0:54 ` Dave Hansen
2022-11-16 6:25 ` Sathyanarayanan Kuppuswamy
2022-11-04 3:23 ` [PATCH v17 2/3] virt: Add TDX guest driver Kuppuswamy Sathyanarayanan
2022-11-09 14:24 ` Wander Lairson Costa
2022-11-09 15:36 ` Sathyanarayanan Kuppuswamy
2022-11-09 15:37 ` Sathyanarayanan Kuppuswamy
2022-11-10 15:17 ` Wander Lairson Costa
2022-11-04 3:23 ` [PATCH v17 3/3] selftests: tdx: Test TDX attestation GetReport support Kuppuswamy Sathyanarayanan
2022-11-10 15:17 ` Wander Lairson Costa
2022-11-10 3:41 ` [PATCH v17 0/3] Add TDX Guest Attestation support Sathyanarayanan Kuppuswamy
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=115a87d7-144a-2828-8e4f-9c1f156b73ae@intel.com \
--to=dave.hansen@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=sathyanarayanan.kuppuswamy@linux.intel.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