Re: [PATCH 02/15] x86/virt/tdx: Add extra memory to TDX Module for Extensions

From: Adrian Hunter

Date: Tue Jun 09 2026 - 09:42:17 EST


On 22/05/2026 06:41, Xu Yilun wrote:
> +static int tdx_ext_mem_add(struct page *root, unsigned int nr_pages)
> +{
> + struct tdx_module_args args = {
> + .rcx = to_hpa_list_info(root, nr_pages),
> + };
> + u64 r;
> +
> + tdx_clflush_hpa_list(root, nr_pages);
> +
> + do {
> + /*
> + * TDH_EXT_MEM_ADD is designed to use output parameter RCX to
> + * override/update input parameter RCX, so the caller doesn't
> + * have to do manual parameter update on retry call.
> + */
> + r = seamcall_ret(TDH_EXT_MEM_ADD, &args);
> + } while (r == TDX_INTERRUPTED_RESUMABLE);

Kishon already mentioned checking only the status

> +
> + if (r != TDX_SUCCESS)

Similarly could this also be TDX_EXT_MEMORY_POOL_FULL?

> + return -EFAULT;
> +
> + return 0;
> +}