[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 29 Jun 2023 00:57:13 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "peterz@...radead.org" <peterz@...radead.org>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Raj, Ashok" <ashok.raj@...el.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"david@...hat.com" <david@...hat.com>,
"bagasdotme@...il.com" <bagasdotme@...il.com>,
"Luck, Tony" <tony.luck@...el.com>,
"ak@...ux.intel.com" <ak@...ux.intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>,
"nik.borisov@...e.com" <nik.borisov@...e.com>,
"hpa@...or.com" <hpa@...or.com>, "Shahar, Sagi" <sagis@...gle.com>,
"imammedo@...hat.com" <imammedo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>, "Gao, Chao" <chao.gao@...el.com>,
"Brown, Len" <len.brown@...el.com>,
"sathyanarayanan.kuppuswamy@...ux.intel.com"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
"Huang, Ying" <ying.huang@...el.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v12 09/22] x86/virt/tdx: Use all system memory when
initializing TDX module as TDX memory
On Wed, 2023-06-28 at 16:17 +0200, Peter Zijlstra wrote:
> On Tue, Jun 27, 2023 at 02:12:39AM +1200, Kai Huang wrote:
>
> > +static int tdx_memory_notifier(struct notifier_block *nb, unsigned long action,
> > + void *v)
> > +{
> > + struct memory_notify *mn = v;
> > +
> > + if (action != MEM_GOING_ONLINE)
> > + return NOTIFY_OK;
>
> So offlining TDX memory is ok?
Yes. We want to support normal software memory hotplug logic even TDX is
enabled. User can offline part of memory and then online again.
>
> > +
> > + /*
> > + * Empty list means TDX isn't enabled. Allow any memory
> > + * to go online.
> > + */
> > + if (list_empty(&tdx_memlist))
> > + return NOTIFY_OK;
> > +
> > + /*
> > + * The TDX memory configuration is static and can not be
> > + * changed. Reject onlining any memory which is outside of
> > + * the static configuration whether it supports TDX or not.
> > + */
> > + return is_tdx_memory(mn->start_pfn, mn->start_pfn + mn->nr_pages) ?
> > + NOTIFY_OK : NOTIFY_BAD;
>
> if (is_tdx_memory(...))
> return NOTIFY_OK;
>
> return NOTIFY_BAD;
>
Sure will do. Thanks!
>
Powered by blists - more mailing lists