[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97945fb19901f6ec11c72b015f55f6bb42cbc7c1.camel@intel.com>
Date: Fri, 24 Jun 2022 23:23:13 +1200
From: Kai Huang <kai.huang@...el.com>
To: Chao Gao <chao.gao@...el.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-mm@...ck.org, seanjc@...gle.com, pbonzini@...hat.com,
dave.hansen@...el.com, len.brown@...el.com, tony.luck@...el.com,
rafael.j.wysocki@...el.com, reinette.chatre@...el.com,
dan.j.williams@...el.com, peterz@...radead.org, ak@...ux.intel.com,
kirill.shutemov@...ux.intel.com,
sathyanarayanan.kuppuswamy@...ux.intel.com,
isaku.yamahata@...el.com, akpm@...ux-foundation.org
Subject: Re: [PATCH v5 05/22] x86/virt/tdx: Prevent hot-add driver managed
memory
On Fri, 2022-06-24 at 10:12 +0800, Chao Gao wrote:
> On Wed, Jun 22, 2022 at 11:16:19PM +1200, Kai Huang wrote:
> > @@ -55,6 +55,7 @@
> > #include <asm/uv/uv.h>
> > #include <asm/setup.h>
> > #include <asm/ftrace.h>
> > +#include <asm/tdx.h>
> >
> > #include "mm_internal.h"
> >
> > @@ -972,6 +973,26 @@ int arch_add_memory(int nid, u64 start, u64 size,
> > return add_pages(nid, start_pfn, nr_pages, params);
> > }
> >
> > +int arch_memory_add_precheck(int nid, u64 start, u64 size, mhp_t mhp_flags)
> > +{
> > + if (!platform_tdx_enabled())
> > + return 0;
>
> add a new cc attribute (if existing ones don't fit) for TDX host platform and
> check the attribute here. So that the code here can be reused by other cc
> platforms if they have the same requirement.
Please see my explanation in the commit message:
The __weak arch-specific hook is used instead of a new CC_ATTR similar
to disable software CPU hotplug. It is because some driver managed
memory resources may actually be TDX-capable (such as legacy PMEM, which
is underneath indeed RAM), and the arch-specific hook can be further
enhanced to allow those when needed.
--
Thanks,
-Kai
Powered by blists - more mailing lists