Re: [PATCH v2 05/31] x86/virt/tdx: Extend tdx_page_array to support IOMMU_MT

From: Huang, Kai

Date: Wed Apr 01 2026 - 20:14:01 EST


On Sat, 2026-03-28 at 00:01 +0800, Xu Yilun wrote:
> IOMMU_MT is another TDX Module defined structure similar to HPA_ARRAY_T
> and HPA_LIST_INFO. The difference is it requires multi-order contiguous
> pages for some entries. It adds an additional NUM_PAGES field for every
> multi-order page entry.
>
> Add a dedicated allocation helper for IOMMU_MT. Fortunately put_page()
> works well for both single pages and multi-order folios, simplifying the
> cleanup logic for all allocation methods.

Well I guess you can have a 'free_fn' to free the pages you allocated via
'alloc_fn'? Will this simplify the code and at least keep tdx_page_array
implementation cleaner?

It's strange that you only have a 'alloc_fn' but doesn't have a 'free_fn'
anyway.