Re: [PATCH v3 07/16] x86/virt/tdx: Add tdx_alloc/free_page() helpers

Huang, Kai
2025-09-22T11:27:30Z

On Thu, 2025-09-18 at 16:22 -0700, Edgecombe, Rick P wrote:
> +static void free_pamt_array(u64 *pa_array)
> +{
> + for (int i = 0; i < tdx_dpamt_entry_pages(); i++) {
> + if (!pa_array[i])
> + break;
> +
> + reset_tdx_pages(pa_array[i], PAGE_SIZE);

This needs rebasing I suppose.

> +
> + /*
> + * It might have come from 'prealloc', but this is an error
> + * path. Don't be fancy, just free them. TDH.PHYMEM.PAMT.ADD
> + * only modifies RAX, so the encoded array is still in place.
> + */
> + __free_page(phys_to_page(pa_array[i]));
>

This comment shouldn't be in this patch? The 'prealloc' concept doesn't
exist yet until patch 12 AFAICT.