[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGNtA+E9FT0Q2OUZ@yzhao56-desk.sh.intel.com>
Date: Tue, 1 Jul 2025 13:07:15 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: Ackerley Tng <ackerleytng@...gle.com>
CC: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>, "Shutemov, Kirill"
<kirill.shutemov@...el.com>, "Li, Xiaoyao" <xiaoyao.li@...el.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "Hansen, Dave"
<dave.hansen@...el.com>, "david@...hat.com" <david@...hat.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "tabba@...gle.com"
<tabba@...gle.com>, "vbabka@...e.cz" <vbabka@...e.cz>,
"quic_eberman@...cinc.com" <quic_eberman@...cinc.com>, "michael.roth@....com"
<michael.roth@....com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "seanjc@...gle.com" <seanjc@...gle.com>,
"Peng, Chao P" <chao.p.peng@...el.com>, "Du, Fan" <fan.du@...el.com>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "binbin.wu@...ux.intel.com"
<binbin.wu@...ux.intel.com>, "Weiny, Ira" <ira.weiny@...el.com>, "Li,
Zhiquan1" <zhiquan1.li@...el.com>, "Annapurve, Vishal"
<vannapurve@...gle.com>, "jroedel@...e.de" <jroedel@...e.de>, "Miao, Jun"
<jun.miao@...el.com>, "pgonda@...gle.com" <pgonda@...gle.com>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [RFC PATCH 08/21] KVM: TDX: Increase/decrease folio ref for huge
pages
On Mon, Jun 30, 2025 at 12:25:49PM -0700, Ackerley Tng wrote:
> "Edgecombe, Rick P" <rick.p.edgecombe@...el.com> writes:
>
> > On Mon, 2025-06-30 at 19:13 +0800, Yan Zhao wrote:
> >> > > ok! Lets go f/g. Unless Yan objects.
> >> I'm ok with f/g. But I have two implementation specific questions:
> >>
> >> 1. How to set the HWPoison bit in TDX?
>
> I was thinking to set the HWpoison flag based on page type. If regular
> 4K page, set the flag. If THP page (not (yet) supported by guest_memfd),
> set the has_hwpoison flag, and if HugeTLB page, call
> folio_set_hugetlb_hwpoison().
Could you elaborate on how to call folio_set_hugetlb_hwpoison()?
> But if we go with Rick's suggestion below, then we don't have to figure
> this out.
>
> >> 2. Should we set this bit for non-guest-memfd pages (e.g. for S-EPT pages) ?
> >
> > Argh, I guess we can keep the existing ref count based approach for the other
> > types of TDX owned pages?
> >
>
> Wait TDX can only use guest_memfd pages, right? Even if TDX can use
> non-guest_memfd pages, why not also set HWpoison for non-guest_memfd
> pages?
As in https://lore.kernel.org/all/aGJxU95VvQvQ3bj6@yzhao56-desk.sh.intel.com/,
I don't find a proper interface for TDX to set HWpoison bit on non-guset_memfd
pages.
Neither memory_failure() nor memory_failure_queue() seem fit.
Powered by blists - more mailing lists