From: "Huang, Kai" <kai.huang@intel.com>
To: "corbet@lwn.net" <corbet@lwn.net>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"shuah@kernel.org" <shuah@kernel.org>,
"sathyanarayanan.kuppuswamy@linux.intel.com"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"x86@kernel.org" <x86@kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>
Cc: "linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>,
"Yu, Guorui" <guorui.yu@linux.alibaba.com>,
"qinkun@apache.org" <qinkun@apache.org>,
"wander@redhat.com" <wander@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"chongc@google.com" <chongc@google.com>,
"Aktas, Erdem" <erdemaktas@google.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"Luck, Tony" <tony.luck@intel.com>,
"dionnaglaze@google.com" <dionnaglaze@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
"Du, Fan" <fan.du@intel.com>
Subject: Re: [PATCH v3 2/3] virt: tdx-guest: Add Quote generation support
Date: Mon, 12 Jun 2023 12:50:03 +0000 [thread overview]
Message-ID: <e99330db8d37b179a69f3ea85bda06eb09338cee.camel@intel.com> (raw)
In-Reply-To: <3c1716d095cfca1903a1ebe9d1541d19b62e480e.1684048511.git.sathyanarayanan.kuppuswamy@linux.intel.com>
On Sun, 2023-05-14 at 00:23 -0700, Kuppuswamy Sathyanarayanan wrote:
> In TDX guest, the attestation process is used to verify the TDX guest
> trustworthiness to other entities before provisioning secrets to the
> guest. The First step in the attestation process is TDREPORT
> generation, which involves getting the guest measurement data in the
> format of TDREPORT, which is further used to validate the authenticity
> of the TDX guest. TDREPORT by design is integrity-protected and can
> only be verified on the local machine.
>
> To support remote verification of the TDREPORT (in a SGX-based
> attestation), the TDREPORT needs to be sent to the SGX Quoting Enclave
> (QE) to convert it to a remote verifiable Quote. SGX QE by design can
> only run outside of the TDX guest (i.e. in a host process or in a
> normal VM) and guest can use communication channels like vsock or
> TCP/IP to send the TDREPORT to the QE. But for security concerns, the
> TDX guest may not support these communication channels. To handle such
> cases, TDX defines a GetQuote hypercall which can be used by the guest
> to request the host VMM to communicate with the SGX QE. More details
> about GetQuote hypercall can be found in TDX Guest-Host Communication
> Interface (GHCI) for Intel TDX 1.0, section titled
> "TDG.VP.VMCALL<GetQuote>".
>
> Add support for TDX_CMD_GET_QUOTE IOCTL to allow an attestation agent
> to submit GetQuote requests from the user space using GetQuote
> hypercall.
>
> Since GetQuote is an asynchronous request hypercall, VMM will use the
> callback interrupt vector configured by the SetupEventNotifyInterrupt
> hypercall to notify the guest about Quote generation completion or
> failure. So register an IRQ handler for it.
>
> GetQuote TDVMCALL requires TD guest pass a 4K aligned shared buffer
> with TDREPORT data as input, which is further used by the VMM to copy
> the TD Quote result after successful Quote generation. To create the
> shared buffer, allocate a large enough memory and mark it shared using
> set_memory_decrypted() in tdx_guest_init(). This buffer will be re-used
> for GetQuote requests in TDX_CMD_GET_QUOTE IOCTL handler.
>
> Although this method reserves a fixed chunk of memory for GetQuote
> requests, such one-time allocation is preferable to the alternative
> choice of repeatedly allocating/freeing the shared buffer in the
> TDX_CMD_GET_QUOTE IOCTL handler, which will damage the direct map
> (because the sharing/unsharing process modifies the direct map). This
> allocation model is similar to that used by the AMD SEV guest driver.
>
> Since the Quote generation process is not time-critical or frequently
> used, the current version does not support parallel GetQuote requests.
>
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> Reviewed-by: Andi Kleen <ak@linux.intel.com>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Reviewed-by: Erdem Aktas <erdemaktas@google.com>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
Acked-by: Kai Huang <kai.huang@intel.com>
next prev parent reply other threads:[~2023-06-12 12:50 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-14 7:23 [PATCH v3 0/3] TDX Guest Quote generation support Kuppuswamy Sathyanarayanan
2023-05-14 7:23 ` [PATCH v3 1/3] x86/tdx: Add TDX Guest event notify interrupt support Kuppuswamy Sathyanarayanan
2023-06-12 12:49 ` Huang, Kai
2023-08-23 20:47 ` Thomas Gleixner
2023-05-14 7:23 ` [PATCH v3 2/3] virt: tdx-guest: Add Quote generation support Kuppuswamy Sathyanarayanan
2023-06-12 12:50 ` Huang, Kai [this message]
2023-05-14 7:23 ` [PATCH v3 3/3] selftests/tdx: Test GetQuote TDX attestation feature Kuppuswamy Sathyanarayanan
2023-06-12 19:03 ` Dan Williams
2023-06-19 5:38 ` Sathyanarayanan Kuppuswamy
2023-06-22 23:31 ` Erdem Aktas
2023-06-22 23:44 ` Huang, Kai
2023-06-23 22:31 ` Dan Williams
2023-06-23 22:27 ` Dan Williams
2023-06-26 3:05 ` Sathyanarayanan Kuppuswamy
2023-06-26 18:57 ` Dionna Amalie Glaze
2023-06-27 0:39 ` Sathyanarayanan Kuppuswamy
2023-06-28 15:41 ` Samuel Ortiz
2023-06-28 15:55 ` Sathyanarayanan Kuppuswamy
2023-06-28 0:11 ` Dan Williams
2023-06-28 1:36 ` Dionna Amalie Glaze
2023-06-28 2:16 ` Huang, Kai
2023-06-28 6:46 ` gregkh
2023-06-28 8:56 ` Huang, Kai
2023-06-28 9:02 ` gregkh
2023-06-28 9:45 ` Huang, Kai
2023-06-28 2:52 ` Dan Williams
2023-06-29 16:25 ` Dionna Amalie Glaze
2023-06-28 15:31 ` Samuel Ortiz
2023-06-28 15:24 ` Samuel Ortiz
2023-06-27 23:44 ` Dan Williams
2023-06-28 2:47 ` Huang, Kai
[not found] ` <CAAYXXYyK4g9k7a78CU9w6Sn9KTBdoNLOu9gcgrSHJfp+3-tO=w@mail.gmail.com>
2023-06-23 22:49 ` Dan Williams
2023-08-23 8:25 ` Thomas Gleixner
2023-05-24 21:33 ` [PATCH v3 0/3] TDX Guest Quote generation support Chong Cai
2023-05-25 22:55 ` Sathyanarayanan Kuppuswamy
2023-06-24 4:05 ` Dan Williams
2023-06-25 20:21 ` Dan Williams
2023-06-26 3:07 ` Sathyanarayanan Kuppuswamy
2023-06-26 4:31 ` Dan Williams
2023-06-27 7:50 ` Chong Cai
2023-08-23 7:33 ` Thomas Gleixner
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=e99330db8d37b179a69f3ea85bda06eb09338cee.camel@intel.com \
--to=kai.huang@intel.com \
--cc=bp@alien8.de \
--cc=chongc@google.com \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=dionnaglaze@google.com \
--cc=erdemaktas@google.com \
--cc=fan.du@intel.com \
--cc=guorui.yu@linux.alibaba.com \
--cc=hpa@zytor.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=mingo@redhat.com \
--cc=qinkun@apache.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--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