]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: TDX: Fold tdx_mem_page_record_premap_cnt() into its sole caller
authorSean Christopherson <seanjc@google.com>
Thu, 30 Oct 2025 20:09:38 +0000 (13:09 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 5 Nov 2025 19:05:53 +0000 (11:05 -0800)
commitb4b2b6eda5afa92f42fd1cd67f2729acf7e95f5b
treede25d2dd71796cddec234dc84f4f512d0eb34ad4
parentaf96d5452e5e88019bed9c081d4be1c489d7c081
KVM: TDX: Fold tdx_mem_page_record_premap_cnt() into its sole caller

Fold tdx_mem_page_record_premap_cnt() into tdx_sept_set_private_spte() as
providing a one-off helper for effectively three lines of code is at best a
wash, and splitting the code makes the comment for smp_rmb()  _extremely_
confusing as the comment talks about reading kvm->arch.pre_fault_allowed
before kvm_tdx->state, but the immediately visible code does the exact
opposite.

Opportunistically rewrite the comments to more explicitly explain who is
checking what, as well as _why_ the ordering matters.

No functional change intended.

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Yan Zhao <yan.y.zhao@intel.com>
Tested-by: Yan Zhao <yan.y.zhao@intel.com>
Tested-by: Kai Huang <kai.huang@intel.com>
Link: https://patch.msgid.link/20251030200951.3402865-16-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/tdx.c