linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kai Huang <kai.huang@intel.com>
To: Chao Gao <chao.gao@intel.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	linux-mm@kvack.org,  seanjc@google.com, pbonzini@redhat.com,
	dave.hansen@intel.com, len.brown@intel.com,  tony.luck@intel.com,
	rafael.j.wysocki@intel.com, reinette.chatre@intel.com,
	 dan.j.williams@intel.com, peterz@infradead.org,
	ak@linux.intel.com,  kirill.shutemov@linux.intel.com,
	sathyanarayanan.kuppuswamy@linux.intel.com,
	 isaku.yamahata@intel.com, akpm@linux-foundation.org
Subject: Re: [PATCH v5 05/22] x86/virt/tdx: Prevent hot-add driver managed memory
Date: Fri, 24 Jun 2022 23:23:13 +1200	[thread overview]
Message-ID: <97945fb19901f6ec11c72b015f55f6bb42cbc7c1.camel@intel.com> (raw)
In-Reply-To: <20220624021200.GB15566@gao-cwp>

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




  reply	other threads:[~2022-06-24 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 11:15 [PATCH v5 00/22] TDX host kernel support Kai Huang
2022-06-22 11:16 ` [PATCH v5 05/22] x86/virt/tdx: Prevent hot-add driver managed memory Kai Huang
2022-06-24  2:12   ` Chao Gao
2022-06-24 11:23     ` Kai Huang [this message]
2022-06-24 19:01   ` Dave Hansen
2022-06-27  5:27     ` Kai Huang
2022-06-24 19:47 ` [PATCH v5 00/22] TDX host kernel support Dave Hansen
2022-06-27  4:09   ` Kai Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97945fb19901f6ec11c72b015f55f6bb42cbc7c1.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=chao.gao@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=reinette.chatre@intel.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=seanjc@google.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox