From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 1B2883168EB; Tue, 26 May 2026 02:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779762938; cv=none; b=R1m6tivMpxcQnLDqld1zpQEa4YFnUNx2HGmk/DzmW419Yg1R58ch12v1cKZ9U7ujDAD4BsK1WQkGsE1DDql1SgOcIWFAdd07RCRAJ4OVGrDloMW7pWHpPhKPizrgAy3dtmnDRPDEOGhdxfwE4P9hERCG3uotSP0qb3Qg838Pz7k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779762938; c=relaxed/simple; bh=YVw8pzRdsCVjF1UzuZe5H17KLA9HaNPb5qcIEy92d54=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fZb+Z79YPZbRgUvrUxeCtcLhAqBTsV4ub4A70OP9tW+ALPe7TM0h65OrL5sFL8LYYLBeibnx9C4fTO4qF9pl5aY7SPeWtj+x5jv6jbEWRvtAqVNb/MrUvPKoEcmoaiHIWpJB4+mkw+Z7ZO9Iw11f1OPiXIF7SPCQ0jQTcwe60qM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Hj9JnxvM; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Hj9JnxvM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1779762936; x=1811298936; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YVw8pzRdsCVjF1UzuZe5H17KLA9HaNPb5qcIEy92d54=; b=Hj9JnxvMLhsgbCriL3Kt++MhDQyt1o1ipxCuwospzo3Jq/0NhFHSov9j wWOjOVBvtfxDw5fjw4+COkv4be+BybXJV1/TxSTP+pV2e6OVsbhZstyRJ DpnqhL0pdpcnJ5ILNzQSub65OCCP0tp9mHFH9KbOfpYdYMuxDunGexD/c zvFpT4PLN1w6EuSd2lw5Pfjw5iSEjBd3gCSTeQ+dNyMa7GveWtRpnn+bP WGTgFG4tAU2YgRBqrFtsYyh6xHzOfhBCGXOuaMXeQTHKdIFqRPUh9AAFZ PFpSyP+DFOb645vTDXZk/D/vUBTeJ/A0KQkQi8pAPUoTVSuihw2bhAsX7 A==; X-CSE-ConnectionGUID: q/wujdeAT32mTHEbn2sXLA== X-CSE-MsgGUID: GmP0Nf4lSNKmiH9p4+gzCw== X-IronPort-AV: E=McAfee;i="6800,10657,11797"; a="91677858" X-IronPort-AV: E=Sophos;i="6.24,168,1774335600"; d="scan'208";a="91677858" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2026 19:35:24 -0700 X-CSE-ConnectionGUID: zMLBCN4HSsO/XtP2+Y/1aw== X-CSE-MsgGUID: vGSy2OVJSyqKUsT6vvFdxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,168,1774335600"; d="scan'208";a="279878331" Received: from rpedgeco-desk.jf.intel.com ([10.88.27.139]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2026 19:35:24 -0700 From: Rick Edgecombe To: bp@alien8.de, dave.hansen@intel.com, hpa@zytor.com, kas@kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, nik.borisov@suse.com, pbonzini@redhat.com, seanjc@google.com, tglx@kernel.org, vannapurve@google.com, x86@kernel.org, chao.gao@intel.com, yan.y.zhao@intel.com, kai.huang@intel.com Cc: rick.p.edgecombe@intel.com, "Kirill A. Shutemov" Subject: [PATCH v6 11/11] Documentation/x86: Add documentation for TDX's Dynamic PAMT Date: Mon, 25 May 2026 19:35:15 -0700 Message-ID: <20260526023515.288829-12-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260526023515.288829-1-rick.p.edgecombe@intel.com> References: <20260526023515.288829-1-rick.p.edgecombe@intel.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Kirill A. Shutemov" Expand TDX documentation to include information on the Dynamic PAMT feature. The new section explains PAMT support in the TDX module and how Dynamic PAMT affects the kernel memory use. Assisted-by: Sashiko:claude-opus-4-6 GitHub Copilot:claude-opus-4-6 Claude:claude-opus-4-7 Signed-off-by: Kirill A. Shutemov Co-developed-by: Rick Edgecombe Signed-off-by: Rick Edgecombe --- v6: - Add missing word (Binbin) - Use "::" instead of ":" - Make format of dmesg example accurate v3: - Trim down docs to be about things that user cares about, instead of development history and other details like this. --- Documentation/arch/x86/tdx.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Documentation/arch/x86/tdx.rst b/Documentation/arch/x86/tdx.rst index ff6b110291bc6..ce026a88b6f78 100644 --- a/Documentation/arch/x86/tdx.rst +++ b/Documentation/arch/x86/tdx.rst @@ -73,6 +73,28 @@ initialize:: [..] virt/tdx: TDX-Module initialization failed ... +Dynamic PAMT +------------ + +PAMT is memory that the TDX module needs to keep data about each page +(think like struct page). It needs to be handed to the TDX module for its +exclusive use. For normal PAMT, this is installed when the TDX module +is first loaded and comes to about 0.4% of system memory. + +Dynamic PAMT is a TDX feature that allows VMM to allocate part of the +PAMT as needed (the parts for tracking 4KB size pages). The other page +sizes (1GB and 2MB) are still allocated statically at the time of +TDX module initialization. This reduces the amount of memory that TDX +uses while TDs are not in use. + +When Dynamic PAMT is in use, dmesg shows it like:: + + [..] virt/tdx: Enable Dynamic PAMT + [..] virt/tdx: 10092 KB allocated for PAMT + [..] virt/tdx: TDX-Module initialized + +Dynamic PAMT is enabled automatically if supported. + TDX Interaction to Other Kernel Components ------------------------------------------ -- 2.54.0