Re: [RFC PATCH 02/21] x86/virt/tdx: Enhance tdh_mem_page_aug() to support huge pages
From: Yan Zhao
Date: Mon Jun 23 2025 - 05:38:30 EST
On Thu, Jun 19, 2025 at 12:26:07PM +0300, Nikolay Borisov wrote:
> > What about Binbin's proposal [1]? i.e.,
> >
> > while (nr_pages)
> > tdx_clflush_page(nth_page(page, --nr_pages));
>
> What's the problem with using:
>
> + for (int i = 0; nr_pages; nr_pages--)
> + tdx_clflush_page(nth_page(page, i++))
Thanks! It looks good to me.
> The kernel now allows C99-style definition of variables inside a loop + it's
> clear how many times the loop has to be executed.