Re: [PATCH 2/2] x86/virt/tdx: Use PFN directly for unmapping guest private memory

From: Yan Zhao

Date: Mon Apr 06 2026 - 21:24:26 EST


On Sat, Apr 04, 2026 at 08:39:00AM +0200, Paolo Bonzini wrote:
> On 3/19/26 09:56, Yan Zhao wrote:
> > On Thu, Mar 19, 2026 at 04:56:10PM +0800, Xiaoyao Li wrote:
> > > So why not considering option 2?
> > >
> > > 2. keep tdx_quirk_reset_page() as-is for the cases of
> > > tdx_reclaim_page() and tdx_reclaim_td_control_pages() that have the
> > > struct page. But only change tdx_sept_remove_private_spte() to use
> > > tdx_quirk_reset_paddr() directly.
> > >
> > > It will need export tdx_quirk_reset_paddr() for KVM. I think it will be OK?
> > I don't think it's necessary. But if we have to export an extra API, IMHO,
> > tdx_quirk_reset_pfn() is better than tdx_quirk_reset_paddr(). Otherwise,
> > why not only expose tdx_quirk_reset_paddr()?
>
> That works for me, it seems the cleanest.
Hi Paolo,
To avoid misunderstanding: you think only exporting tdx_quirk_reset_paddr() is
the cleanest, right? :)

Thanks
Yan