summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2026-09-04 14:58:36 -0700
committerDave Hansen <dave.hansen@linux.intel.com>2026-09-04 15:06:02 -0700
commit86305da521d1dcf44cb2a61140a3e78f390dd873 (patch)
tree1a25d1f57ea422c4f159e3c5f480116f55f3637d /scripts/Makefile.thinlto
parenteca9d4a3f1f820439453f07ce700d316c398520e (diff)
downloadlinux-next-86305da521d1dcf44cb2a61140a3e78f390dd873.tar.gz
linux-next-86305da521d1dcf44cb2a61140a3e78f390dd873.zip
KVM/TDX: Allocate PAMT memory for TD and vCPU control structures
Use control page helpers for allocating and freeing TD control structures, such that these operations can work for Dynamic PAMT. The TDX module tracks some state for each page of physical memory that it might use. It calls this state the PAMT. It includes separate state for each page size a physical page could be utilized at within the TDX module (1GB, 2MB, 4KB). In Dynamic PAMT, only the 4KB page size state is allocated dynamically. So the kernel must ensure PAMT backing is installed for any 4KB page being gifted to the TDX module, and must tear down the backing when all associated gifted pages are reclaimed. TD scoped control pages (TDR, TDCS) and vCPU scoped control pages (TDVPR, TDCX) are all handed to the TDX module at 4KB page size and are therefore subject to this requirement. Replace the raw alloc_page()/__free_page() calls for these pages with tdx_alloc/free_control_page(). Switching between special Dynamic PAMT operations or normal page alloc/free operations is handled internally in tdx_alloc/free_control_page(). So don't check for Dynamic PAMT around these calls. Just call them unconditionally. Similarly, drop the NULL checks before freeing, as tdx_free_control_page() handles NULL internally. No functional change intended when DPAMT is not in use. [sean: handle alloc+free+reclaim in one patch] [rick: enhance log, reviewing, rebase, with help from AI tooling] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com> Reviewed-by: Chao Gao <chao.gao@intel.com> Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Reviewed-by: Tony Lindgren <tony.lindgren@linux.intel.com> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com> Reviewed-by: Vishal Annapurve <vannapurve@google.com> Acked-by: Sohil Mehta <sohil.mehta@intel.com> Acked-by: Sean Christopherson <seanjc@google.com> Tested-by: Hongyu Ning <hongyu.ning@linux.intel.com> Link: https://patch.msgid.link/20260904215841.303070-7-rick.p.edgecombe@intel.com
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions