Re: [PATCH v15 08/23] x86/virt/tdx: Use all system memory when initializing TDX module as TDX memory

Huang, Kai
2024-12-05T12:25:14Z

On Thu, 2024-12-05 at 11:06 +0200, Nikolay Borisov wrote:
> > > +/*
> > > + * Ensure that all memblock memory regions are convertible to TDX
> > > + * memory.  Once this has been established, stash the memblock
> > > + * ranges off in a secondary structure because memblock is modified
> > > + * in memory hotplug while TDX memory regions are fixed.
> > > + */
> > > +static int build_tdx_memlist(struct list_head *tmb_list)
> > > +{
> > > + unsigned long start_pfn, end_pfn;
> > > + int i, ret;
> > > +
> > > + for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
> >
> > Unles ARCH_KEEP_MEMBLOCK is defined this won't work after free_initmem()
>
> TDX_HOST actually selects ARCH_KEEP_MEMBLOCK:
>

Yes. Thanks Nikolay for reply. Somehow I missed this one yesterday.