Re: [RFC PATCH 08/21] KVM: TDX: Increase/decrease folio ref for huge pages

From: Edgecombe, Rick P
Date: Thu Jun 26 2025 - 18:20:08 EST


On Thu, 2025-06-26 at 18:16 +0300, Shutemov, Kirill wrote:
> > > Please see my reply to Yan, I'm hoping y'all will agree to something
> > > between option f/g instead.
> >
> > I'm not sure about the HWPoison approach, but I'm not totally against it. My
> > bias is that all the MM concepts are tightly interlinked. If may fit
> > perfectly,
> > but every new use needs to be checked for how fits in with the other MM
> > users of
> > it. Every time I've decided a page flag was the perfect solution to my
> > problem,
> > I got informed otherwise. Let me try to flag Kirill to this discussion. He
> > might
> > have some insights.
>
> We chatted with Rick about this.
>
> If I understand correctly, we are discussing the situation where the TDX
> module failed to return a page to the kernel.
>
> I think it is reasonable to use HWPoison for this case. We cannot
> guarantee that we will read back whatever we write to the page. TDX module
> has creative ways to corrupt it.
>
> The memory is no longer functioning as memory. It matches the definition
> of HWPoison quite closely.

ok! Lets go f/g. Unless Yan objects.