[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y33oCuQtLrFugMFc@hirez.programming.kicks-ass.net>
Date: Wed, 23 Nov 2022 10:29:46 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Kai Huang <kai.huang@...el.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-mm@...ck.org, seanjc@...gle.com,
pbonzini@...hat.com, dan.j.williams@...el.com,
rafael.j.wysocki@...el.com, kirill.shutemov@...ux.intel.com,
ying.huang@...el.com, reinette.chatre@...el.com,
len.brown@...el.com, tony.luck@...el.com, ak@...ux.intel.com,
isaku.yamahata@...el.com, chao.gao@...el.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, bagasdotme@...il.com,
sagis@...gle.com, imammedo@...hat.com
Subject: Re: [PATCH v7 10/20] x86/virt/tdx: Use all system memory when
initializing TDX module as TDX memory
On Tue, Nov 22, 2022 at 04:21:38PM -0800, Dave Hansen wrote:
> > + /*
> > + * All memory regions that can be used by the TDX module must be
> > + * passed to the TDX module during the module initialization.
> > + * Once this is done, all "TDX-usable" memory regions are fixed
> > + * during module's runtime.
> > + *
> > + * The initial support of TDX guests only allocates memory from
> > + * the global page allocator. To keep things simple, for now
> > + * just make sure all pages in the page allocator are TDX memory.
> > + *
> > + * To achieve this, use all system memory in the core-mm at the
> > + * time of initializing the TDX module as TDX memory, and at the
> > + * meantime, reject any new memory in memory hot-add.
> > + *
> > + * This works as in practice, all boot-time present DIMM is TDX
> > + * convertible memory. However if any new memory is hot-added
> > + * before initializing the TDX module, the initialization will
> > + * fail due to that memory is not covered by CMR.
> > + *
> > + * This can be enhanced in the future, i.e. by allowing adding or
> > + * onlining non-TDX memory to a separate node, in which case the
> > + * "TDX-capable" nodes and the "non-TDX-capable" nodes can exist
> > + * together -- the userspace/kernel just needs to make sure pages
> > + * for TDX guests must come from those "TDX-capable" nodes.
> > + *
> > + * Build the list of TDX memory regions as mentioned above so
> > + * they can be passed to the TDX module later.
> > + */
>
> This is msotly Documentation/, not a code comment. Please clean it up.
So personally, I *vastly* prefer code comments over this Documentation/
cesspit. Putting things in Documentation/ is a bit like an
old-folks-home, neatly out of the way to (bit)rot in peace.
And that whole .rst disease is making it unreadable for anybody that
still knows how to use a text editor :-(
Powered by blists - more mailing lists