[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7367cae9957dba0142a878531a71f9873e1d6316.camel@intel.com>
Date: Tue, 10 May 2022 11:27:29 +1200
From: Kai Huang <kai.huang@...el.com>
To: Mike Rapoport <rppt@...nel.org>
Cc: Dan Williams <dan.j.williams@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
KVM list <kvm@...r.kernel.org>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Brown, Len" <len.brown@...el.com>,
"Luck, Tony" <tony.luck@...el.com>,
Rafael J Wysocki <rafael.j.wysocki@...el.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Andi Kleen <ak@...ux.intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Isaku Yamahata <isaku.yamahata@...el.com>
Subject: Re: [PATCH v3 00/21] TDX host kernel support
> >
> > Hi Mike,
> >
> > Thanks for feedback.
> >
> > Perhaps I haven't put a lot details of the new TDX data structures, so let me
> > point out that the new two data structures 'struct tdx_memblock' and 'struct
> > tdx_memory' that I am proposing are mostly supposed to be used by TDX code only,
> > which is pretty standalone. They are not supposed to be some basic
> > infrastructure that can be widely used by other random kernel components.
>
> We already have "pretty standalone" numa_meminfo that originally was used
> to setup NUMA memory topology, but now it's used by other code as well.
> And e820 tables also contain similar data and they are supposedly should be
> used only at boot time, but in reality there are too much callbacks into
> e820 way after the system is booted.
>
> So any additional memory representation will only add to the overall
> complexity and well have even more "eventually consistent" collections of
> { .start, .end, .flags } structures.
>
> > In fact, currently the only operation we need is to allow memblock to register
> > all memory regions as TDX memory blocks when the memblock is still alive.
> > Therefore, in fact, the new data structures can even be completely invisible to
> > other kernel components. For instance, TDX code can provide below API w/o
> > exposing any data structures to other kernel components:
> >
> > int tdx_add_memory_block(phys_addr_t start, phys_addr_t end, int nid);
> >
> > And we call above API for each memory region in memblock when it is alive.
> >
> > TDX code internally manages those memory regions via the new data structures
> > that I mentioned above, so we don't need to keep memblock after boot. The
> > advantage of this approach is it is more flexible to support other potential TDX
> > memory resources (such as CLX memory) in the future.
>
> Please let keep things simple. If other TDX memory resources will need
> different handling it can be implemented then. For now, just enable
> ARCH_KEEP_MEMBLOCK and use memblock to track TDX memory.
>
Looks good to me. Thanks for the feedback.
--
Thanks,
-Kai
Powered by blists - more mailing lists