[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aW3MyZ3M0ugyfsLb@yzhao56-desk.sh.intel.com>
Date: Mon, 19 Jan 2026 14:18:49 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: "Huang, Kai" <kai.huang@...el.com>
CC: "Du, Fan" <fan.du@...el.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"Li, Xiaoyao" <xiaoyao.li@...el.com>, "Hansen, Dave" <dave.hansen@...el.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "tabba@...gle.com"
<tabba@...gle.com>, "vbabka@...e.cz" <vbabka@...e.cz>, "david@...nel.org"
<david@...nel.org>, "kas@...nel.org" <kas@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"seanjc@...gle.com" <seanjc@...gle.com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "binbin.wu@...ux.intel.com"
<binbin.wu@...ux.intel.com>, "Weiny, Ira" <ira.weiny@...el.com>,
"nik.borisov@...e.com" <nik.borisov@...e.com>, "Annapurve, Vishal"
<vannapurve@...gle.com>, "ackerleytng@...gle.com" <ackerleytng@...gle.com>,
"Peng, Chao P" <chao.p.peng@...el.com>, "michael.roth@....com"
<michael.roth@....com>, "Yamahata, Isaku" <isaku.yamahata@...el.com>,
"sagis@...gle.com" <sagis@...gle.com>, "Gao, Chao" <chao.gao@...el.com>,
"francescolavra.fl@...il.com" <francescolavra.fl@...il.com>, "Miao, Jun"
<jun.miao@...el.com>, "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"jgross@...e.com" <jgross@...e.com>, "pgonda@...gle.com" <pgonda@...gle.com>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 02/24] x86/virt/tdx: Add SEAMCALL wrapper
tdh_mem_page_demote()
On Fri, Jan 16, 2026 at 07:22:33PM +0800, Huang, Kai wrote:
> On Fri, 2026-01-16 at 11:10 +0000, Huang, Kai wrote:
> > W/o the WARN(), the caller _can_ call this wrapper (i.e., not a kernel
> > bug) but it always get a SW-defined error. Again, maybe it has value for
> > the case where the caller wants to use this to tell whether DEMOTE is
> > available.
> >
> > With the WARN(), it's a kernel bug to call the wrapper, and the caller
> > needs to use other way (i.e., tdx_supports_demote_nointerrupt()) to tell
> > whether DEMOTE is available.
> >
> > So if you want the check, probably WARN() is a better idea since I suppose
> > we always want users to use tdx_supports_demote_nointerrupt() to know
> > whether DEMOTE can be done, and the WARN() is just to catch bug.
>
> Forgot to say, the name tdx_supports_demote_nointerrupt() somehow only
> tells the TDX module *supports* non-interruptible DEMOTE, it doesn't tell
> whether TDX module has *enabled* that.
>
> So while we know for this DEMOTE case, there's no need to *enable* this
> feature (i.e., DEMOTE is non-interruptible when this feature is reported
> as *supported*), from kernel's point of view, is it better to just use a
> clearer name?
>
> E.g., tdx_huge_page_demote_uninterruptible()?
>
> A bonus is the name contains "huge_page" so it's super clear what's the
> demote about.
LGTM. Thanks!
Powered by blists - more mailing lists