On Wed, May 14, 2025 at 03:25:29AM +0800, Edgecombe, Rick P wrote: > On Thu, 2025-04-24 at 11:05 +0800, Yan Zhao wrote: > > /* TDH.PHYMEM.PAGE.RECLAIM is allowed only when destroying the TD. */ > > -static int __tdx_reclaim_page(struct page *page) > > +static int __tdx_reclaim_page(struct page *page, int level) > > { > > u64 err, tdx_pt, tdx_owner, tdx_size; > > > > @@ -340,16 +340,18 @@ static int __tdx_reclaim_page(struct page *page) > > pr_tdx_error_3(TDH_PHYMEM_PAGE_RECLAIM, err, tdx_pt, tdx_owner, tdx_size); > > return -EIO; > > } > > + > > + WARN_ON_ONCE(tdx_size != pg_level_to_tdx_sept_level(level)); > > Why not return an error in this case? Yes, returing error seems reasonable, which indicate a series bug. > > return 0; > > } > > > > No callers in the series pass anything other than PG_LEVEL_4K, so do we need > this patch? Oh, this patch is only for future VM shutdown optimization where huge guest pages could be reclaimed. We can of couse include it in the VM shutdown optimization series if you think it's better.