"Resetting" TDX pages is a workaround for the TDX_PW_MCE erratum. Once a leaf SPTE can map to a huge page in the S-EPT, the entire huge physical range, rather than just the first 4KB, needs to be reset before the host can reuse it. Signed-off-by: Yan Zhao --- arch/x86/kvm/vmx/tdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c index 410c149bf776..11792a490330 100644 --- a/arch/x86/kvm/vmx/tdx.c +++ b/arch/x86/kvm/vmx/tdx.c @@ -1865,7 +1865,7 @@ static int tdx_sept_remove_leaf_spte(struct kvm *kvm, gfn_t gfn, if (TDX_BUG_ON_2(err, TDH_MEM_PAGE_REMOVE, entry, level_state, kvm)) return -EIO; - tdx_quirk_reset_paddr(PFN_PHYS(pfn), PAGE_SIZE); + tdx_quirk_reset_paddr(PFN_PHYS(pfn), KVM_HPAGE_SIZE(level)); tdx_pamt_put(pfn, level); return 0; } -- 2.43.2