From nobody Tue Dec 2 02:04:18 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 5418C2C3268; Fri, 21 Nov 2025 00:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763686315; cv=none; b=VrORIsk9cWNM+tuIW+4elMyPhutIZjLhp2A0wfMhb0nM3sJSEJTg425sjxWK0lPoc7DKTolaE+wEHgZOmy0athnFRq4AnxcCqNguwDB4/sEzltmngVf2XKibxsvz4y0gRXgRRLoLg6u4MLxGSa4kl021HB+1P0RwN9F9y+ZMfvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763686315; c=relaxed/simple; bh=Qn08wBZBmAH/Yg+spHITIdaIKbVoPLtNw0c9VTkKeJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aOCIQ2SkkvKnIepTatZPwkRk3L/qS6NxlriwW2VF0Lq901nslRSWASx3y3S1O/3yMdvz8Hfijq8Po2CC4O/1pndELgTPUplTgPc/nWEVPIYVCxaxVea4rD2IZrNJQXgu5T35Nu8GUOoqZJaH6VlqpA8BtWaHgu3titGVnTABCIU= 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=mcdcvrqS; arc=none smtp.client-ip=192.198.163.19 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="mcdcvrqS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763686313; x=1795222313; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qn08wBZBmAH/Yg+spHITIdaIKbVoPLtNw0c9VTkKeJM=; b=mcdcvrqS1haET2K5kAuUZvMBwAOxQty8cp4LfqAn0/kprjQ7x7hR9Yl+ CcdlPZpVHacg0TkR474GGhku18iUsL3OSqmNNMDIMNyefiwguVz+/r3Wj wY3Ls9dVgA27/hcXwXVGEtzr6vK5CKfzpfSpLTpwpgDDmJDVXYYM4+A2n xHOWUdcF5iJinOgAscjepInQ3Snl705+VSG97jsQFMAa4CtKwJe7UGWpX QqYiJDFSG/vt63AX71aKnFQuRUabM8sb8/Y82aQBevakV7vIsYaOdFsTo ldgf7GokGYsHj+Rgt5ADbkW08Ox5Czg8KeKr9Cx8xdI5l+Oecxo6HCB+D w==; X-CSE-ConnectionGUID: 73J1kCF3TaCKRYvErgZqug== X-CSE-MsgGUID: rrw0J15sSpSkZhodEG0e3w== X-IronPort-AV: E=McAfee;i="6800,10657,11619"; a="64780835" X-IronPort-AV: E=Sophos;i="6.20,214,1758610800"; d="scan'208";a="64780835" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2025 16:51:48 -0800 X-CSE-ConnectionGUID: 9mKq7f/gRoK4VHO1BM6TkA== X-CSE-MsgGUID: ta8uEFNzR4qOM72s1Yhq1w== X-ExtLoop1: 1 Received: from rpedgeco-desk.jf.intel.com ([10.88.27.139]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2025 16:51:47 -0800 From: Rick Edgecombe To: bp@alien8.de, chao.gao@intel.com, dave.hansen@intel.com, isaku.yamahata@intel.com, kai.huang@intel.com, kas@kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, mingo@redhat.com, pbonzini@redhat.com, seanjc@google.com, tglx@linutronix.de, vannapurve@google.com, x86@kernel.org, yan.y.zhao@intel.com, xiaoyao.li@intel.com, binbin.wu@intel.com Cc: rick.p.edgecombe@intel.com, "Kirill A. Shutemov" Subject: [PATCH v4 16/16] Documentation/x86: Add documentation for TDX's Dynamic PAMT Date: Thu, 20 Nov 2025 16:51:25 -0800 Message-ID: <20251121005125.417831-17-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251121005125.417831-1-rick.p.edgecombe@intel.com> References: <20251121005125.417831-1-rick.p.edgecombe@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Kirill A. Shutemov [Add feedback, update log] Signed-off-by: Rick Edgecombe --- 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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/arch/x86/tdx.rst b/Documentation/arch/x86/tdx.rst index 61670e7df2f7..8d45d31fee29 100644 --- a/Documentation/arch/x86/tdx.rst +++ b/Documentation/arch/x86/tdx.rst @@ -99,6 +99,27 @@ initialize:: =20 [..] virt/tdx: module initialization failed ... =20 +Dynamic PAMT +------------ + +PAMT is memory that the TDX module needs to keep data about each page +(think like struct page). It needs to 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: module initialized + +Dynamic PAMT is enabled automatically if supported. + TDX Interaction to Other Kernel Components ------------------------------------------ =20 --=20 2.51.2