[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <50dde948f17a3fe1c9c944ced8df48d59d5481b6.camel@intel.com>
Date: Tue, 20 Jan 2026 23:31:23 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "seanjc@...gle.com" <seanjc@...gle.com>, "x86@...nel.org"
<x86@...nel.org>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "kas@...nel.org" <kas@...nel.org>,
"bp@...en8.de" <bp@...en8.de>, "mingo@...hat.com" <mingo@...hat.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, "tglx@...nel.org"
<tglx@...nel.org>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "Annapurve, Vishal" <vannapurve@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Edgecombe,
Rick P" <rick.p.edgecombe@...el.com>, "Zhao, Yan Y" <yan.y.zhao@...el.com>,
"ackerleytng@...gle.com" <ackerleytng@...gle.com>
Subject: Re: [PATCH] x86/tdx: Use pg_level in TDX APIs, not the TDX-Module's
0-based level
On Tue, 2026-01-20 at 12:39 -0800, Sean Christopherson wrote:
> Rework the TDX APIs to take the kernel's 1-based pg_level enum, not the
> TDX-Module's 0-based level. The APIs are _kernel_ APIs, not TDX-Module
> APIs, and the kernel (and KVM) uses "enum pg_level" literally everywhere.
>
> Using "enum pg_level" eliminates ambiguity when looking at the APIs (it's
> NOT clear that "int level" refers to the TDX-Module's level), and will
> allow for using existing helpers like page_level_size() when support for
> hugepages is added to the S-EPT APIs.
>
> No functional change intended.
>
> Cc: Kai Huang <kai.huang@...el.com>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: Rick Edgecombe <rick.p.edgecombe@...el.com>
> Cc: Yan Zhao <yan.y.zhao@...el.com>
> Cc: Vishal Annapurve <vannapurve@...gle.com>
> Cc: Ackerley Tng <ackerleytng@...gle.com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
>
Tested that running/destroying TD worked fine:
Reviewed-by: Kai Huang <kai.huang@...el.com>
Tested-by: Kai Huang <kai.huang@...el.com>
Powered by blists - more mailing lists