lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9b7b375019873b4bf8fccd93b3b1b53778ca3c0.camel@intel.com>
Date: Fri, 16 Jan 2026 11:22:33 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Zhao, Yan Y" <yan.y.zhao@...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, 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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ