From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C86C48124A; Wed, 21 Jan 2026 12:32:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768998756; cv=none; b=DLJLgbBT55mcsfJNJXFKhYz+8Zx15brQVLETIDj1M4t2RRcBnEiPh1bj2XCuDDgu9fOmga5W0PmQ/l+jAnGdv7UQGfEQsyfY5yk6jSfcsiL9HEq6BJjEQKEqkGNB7ro/JX+rVO5c1QWol+KPMUHhbXYBbdGg6TidfGYV/mm4zM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768998756; c=relaxed/simple; bh=9INNlyYJIxn6FYma2m4J/etePBze8DGUW7xkS+dhtwg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pgZR5Id+DEi84qFUN9fyCK9piSME8jc4hqi2N5QxU7rDmGvfB6G1lxER9g0JPHnpuv6h/GdveEyP6Sjxsg96jJkjvQcCs5ICR0D3AQH12IAK8YqR0//wEZTI+S7NcT9A7FqTgmNbfeiCyL531A0c/O9Zb18Oh1hmOthykqV9BoQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eMUFHYYp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eMUFHYYp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D3E3C2BC86; Wed, 21 Jan 2026 12:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768998755; bh=9INNlyYJIxn6FYma2m4J/etePBze8DGUW7xkS+dhtwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eMUFHYYpQYjG++XvtHjgtl57q/JLvzJfeYv0vnez0SVrZt8uGC+w/jyh7Glw5tmfs mhacbxniDsT2XABiw7u4VXGfke5Sp9fkcpJkC4Q53cV+/n+yYw1ejwTLK0HHDKfq8X N8zhMPxrh5Zo+kKxiHuDVoOjsCHnveo2ppXNippvvje3l6pInVFFpnS1Mx54/Lq/Lu hKMhc1CEcdaWKSH1aYx4ftrx2RHpLWCpBIwCqp1ImfjImErvnaDvG87E//RM+uastH iYf9n9jd82K+wBdZRRM+acSIQ/GdhRmYpJEp+ZghXPKZ71gsJCeJ/y6w6JjdxnntFk AoSOeuyvJ2NPA== Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfauth.phl.internal (Postfix) with ESMTP id 8C905F4006B; Wed, 21 Jan 2026 07:32:34 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 21 Jan 2026 07:32:34 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeefvdelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepmfhirhihlhcu ufhhuhhtshgvmhgruhcuoehkrghssehkvghrnhgvlhdrohhrgheqnecuggftrfgrthhtvg hrnhepueeijeeiffekheeffffftdekleefleehhfefhfduheejhedvffeluedvudefgfek necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhirh hilhhlodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduieduudeivdeiheeh qddvkeeggeegjedvkedqkhgrsheppehkvghrnhgvlhdrohhrghesshhhuhhtvghmohhvrd hnrghmvgdpnhgspghrtghpthhtohepfedtpdhmohguvgepshhmthhpohhuthdprhgtphht thhopehsvggrnhhjtgesghhoohhglhgvrdgtohhmpdhrtghpthhtohepthhglhigsehkvg hrnhgvlhdrohhrghdprhgtphhtthhopehmihhnghhosehrvgguhhgrthdrtghomhdprhgt phhtthhopegsphesrghlihgvnhekrdguvgdprhgtphhtthhopegurghvvgdrhhgrnhhsvg hnsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepgiekieeskhgvrhhnvghl rdhorhhgpdhrtghpthhtohepphgsohhniihinhhisehrvgguhhgrthdrtghomhdprhgtph htthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopehlihhnuhigqdgtohgtoheslhhishhtshdrlhhinhhugidruggvvh X-ME-Proxy: Feedback-ID: i10464835:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jan 2026 07:32:32 -0500 (EST) Date: Wed, 21 Jan 2026 12:32:27 +0000 From: Kiryl Shutsemau To: Sean Christopherson Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Paolo Bonzini , linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, Kai Huang , Rick Edgecombe , Yan Zhao , Vishal Annapurve , Ackerley Tng Subject: Re: [PATCH] x86/tdx: Use pg_level in TDX APIs, not the TDX-Module's 0-based level Message-ID: References: <20260120203937.1447592-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260120203937.1447592-1-seanjc@google.com> On Tue, Jan 20, 2026 at 12:39:37PM -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 > Cc: Dave Hansen > Cc: Rick Edgecombe > Cc: Yan Zhao > Cc: Vishal Annapurve > Cc: Ackerley Tng > Signed-off-by: Sean Christopherson Acked-by: Kiryl Shutsemau -- Kiryl Shutsemau / Kirill A. Shutemov