From nobody Sun Feb 8 21:28:13 2026 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97FBE346E6C for ; Thu, 29 Jan 2026 01:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769649376; cv=none; b=jP9sNF4OHPaSMVigkTbyvY/PIQY4h/WAc8S/m91cKMb+I86Iik/YWi6h5Uv3hR4e90dtIqvH7lh8GqrHcXT9RbR33xXON9ayKbrLB0Q8UhoG/+pQJqj7ETOUFhySGeEtwennUP/2P44c8AEZ9ZB9Z2wrQZID+AphrKnYDCyIquQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769649376; c=relaxed/simple; bh=EJA7XKSAHRGSswQQXcHnUMuba3R8D9sqLu/XxynOWLo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VHN4DHJldFn0I4Fqcn1qSvxbTQ25cZ5ENG+gaFCZtK1zg7MEPe1kPov76PM53/g09lvtOVmHTGmK34jr+Tc3MwTlEAwkR7GDtVNdNW+nzGy/RIOHG1VdN8GBYVolaRSVcinZzvJSC9RelKz/MEW3ojUXYEM6/4AmfRW5pxxBKcs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Ff/6Xpj+; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Ff/6Xpj+" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-34ea5074935so323275a91.0 for ; Wed, 28 Jan 2026 17:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769649374; x=1770254174; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=1krQa7Jk7W59zRdRjLWbI+ZDvWi8VJAVMG8mEFH1axA=; b=Ff/6Xpj+vVRGLtSWAW8NM97AymcBmXePAsKwwO0hZbU2oJ/1OwDq5niySedVhiZwQk r8MSPu5iYBixrJiFwKfu1fmo1LMpf33zVyMnQaTfV/mggyAqWYzMBQ5m7FDpFMwJFB/L An4AXuA5Gd6Xs6sb5oCgYnacYU/e0eMeVr5jBVTQ3LGSYZT9UPzEbXaW1iTG/xizgO2L t9ZLnGFoYxDC/v2tE9MjjbkmOObA9Z/nxrJOAmWvp1PZF2iNfjn6BORECmMRsjCIwQ1F LTKkGQfJRojtq9GrYvUpTCDWhDbKR0T62P4S/Ukjj+ENbl5IkfperRxg549Iy1YIIEIv Hj3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769649374; x=1770254174; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1krQa7Jk7W59zRdRjLWbI+ZDvWi8VJAVMG8mEFH1axA=; b=rd1pgB/+VH8YD5oaTu55s44DhENt52n24yeO3jj43FagilYU6WMzzgCeTCE6xlmnM7 2/6PgvoOVweGhgcKoUu6xpoXPulZcpFy6q6dJ4WctGAmiYRj3suqv6CnSma2mQ0VUUxO GhdAb9dH4R0KF6S+Oy4xqfPdomW5391U0DekrWWNo2URZqkkEslQ8bouGVH+RulztegZ vPP/QtMc7V2VS7FdT/OlvZEBPNrssrRusCM34aqj3MunowN5DQk5oJhCiH5Frs7Uukl4 xFeXexEOnGCTkZ7zeD1p8hsPngu23MdhcHtuEiuY1VKBo17fZP+1sheQRhWV5H86NND/ nOiQ== X-Gm-Message-State: AOJu0YwxXs6Xg7kUNNxxYX3lBWlH1PjaM3t0rLoTp7cl6HL/TMRhspmS E+AmyljNV4Ke09jfoUISf28WyJr9ymXcpwwTpFCa3JTeLhOBA8SBeH/845dXCLEsVV72zYKysFx 1UvNeBQ== X-Received: from pjph21.prod.google.com ([2002:a17:90a:9c15:b0:352:c3aa:9e08]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:270e:b0:34a:b459:bd10 with SMTP id 98e67ed59e1d1-353fed7104bmr6156493a91.24.1769649373991; Wed, 28 Jan 2026 17:16:13 -0800 (PST) Reply-To: Sean Christopherson Date: Wed, 28 Jan 2026 17:14:56 -0800 In-Reply-To: <20260129011517.3545883-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260129011517.3545883-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.rc1.217.geba53bf80e-goog Message-ID: <20260129011517.3545883-25-seanjc@google.com> Subject: [RFC PATCH v5 24/45] Documentation/x86: Add documentation for TDX's Dynamic PAMT From: Sean Christopherson To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Kiryl Shutsemau , Sean Christopherson , Paolo Bonzini Cc: linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, kvm@vger.kernel.org, Kai Huang , Rick Edgecombe , Yan Zhao , Vishal Annapurve , Ackerley Tng , Sagi Shahar , Binbin Wu , Xiaoyao Li , Isaku Yamahata 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 Tested-by: Sagi Shahar Signed-off-by: Sean Christopherson --- 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.53.0.rc1.217.geba53bf80e-goog