Re: [PATCH v2 2/2] x86/virt/tdx: Drop tdh_phymem_page_wbinvd_*()
From: Xu Yilun
Date: Tue Oct 20 2026 - 07:01:03 EST
> KVM previously needed to call different types of tdh_phymem_page_wbinvd_*()
> helpers for different types of reclaim. So it had a stack of helpers and
> some open coded logic to use them in the rarer TDR reclaim case. Now that
> the wbinvd is gone, the steps for each operation are logically equivalent.
> So collapse the helpers and just call tdx_reclaim_control_page() from the
> TDR reclaim path.
>
> This unification brings TDR reclaim in line with the behavior of the other
> reclaim paths, by handling TDH.PHYMEM.PAGE.RECLAIM failure by leaking the
> page and setting the TDR page pointer to NULL. This results in reclaim not
> being tried a second time, which is reasonable because the first reclaim
> failing suggests a problem with the TDX module.
Ah, it really is bigger than expected: Removing __tdx_reclaim_page();
unconditionally nullify kvm_tdx->td.tdr_page;
Personally, I would split the helper collapsion into the 3rd patch in
this series. But I'm also good this way.
Reviewed-by: Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx>