Re: [PATCH v5 1/6] x86/tdx: Take the Quote buffer as a generic pointer
From: Kuppuswamy Sathyanarayanan
Date: Mon Sep 28 2026 - 16:10:47 EST
Hi,
On 9/28/2026 3:08 AM, Peter Fang wrote:
> tdx_hcall_get_quote() takes a "u8 *" buffer unnecessarily. It is never
> used as such, since only the buffer's memory address matters. Let the
> guest driver give the buffer a type internally and just accept it as a
> "void *" instead.
>
> AI was used under supervision to collect/apply feedback, review code and
> workshop logs.
>
> Signed-off-by: Peter Fang <peter.fang@xxxxxxxxx>
> ---
Looks good to me.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
> v5:
> - New patch. Prepare for a typed Quote buffer. [Dave]
> ---
> arch/x86/coco/tdx/tdx.c | 2 +-
> arch/x86/include/asm/tdx.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> index f904a636d449..bcaf4180a8db 100644
> --- a/arch/x86/coco/tdx/tdx.c
> +++ b/arch/x86/coco/tdx/tdx.c
> @@ -191,7 +191,7 @@ EXPORT_SYMBOL_GPL(tdx_mcall_extend_rtmr);
> *
> * Return 0 on success or error code on failure.
> */
> -u64 tdx_hcall_get_quote(u8 *buf, size_t size)
> +u64 tdx_hcall_get_quote(void *buf, size_t size)
> {
> /* Since buf is a shared memory, set the shared (decrypted) bits */
> return _tdx_hypercall(TDVMCALL_GET_QUOTE, cc_mkdec(virt_to_phys(buf)), size, 0, 0);
> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 89e97d5761d8..a3c37d61e676 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -81,7 +81,7 @@ int tdx_mcall_get_report0(u8 *reportdata, u8 *tdreport);
>
> int tdx_mcall_extend_rtmr(u8 index, u8 *data);
>
> -u64 tdx_hcall_get_quote(u8 *buf, size_t size);
> +u64 tdx_hcall_get_quote(void *buf, size_t size);
>
> void __init tdx_dump_attributes(u64 td_attr);
> void __init tdx_dump_td_ctls(u64 td_ctls);
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer