[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <l3wzjxkokrcuu7mguuojr5vnzfwjpjfxgg3d6pw5zmmgsgpdfv@wz6gvpglqkiz>
Date: Fri, 19 Sep 2025 10:55:36 +0100
From: Kiryl Shutsemau <kas@...nel.org>
To: Rick Edgecombe <rick.p.edgecombe@...el.com>
Cc: bp@...en8.de, chao.gao@...el.com, dave.hansen@...ux.intel.com,
isaku.yamahata@...el.com, kai.huang@...el.com, kvm@...r.kernel.org,
linux-coco@...ts.linux.dev, linux-kernel@...r.kernel.org, mingo@...hat.com,
pbonzini@...hat.com, seanjc@...gle.com, tglx@...utronix.de, x86@...nel.org,
yan.y.zhao@...el.com, vannapurve@...gle.com
Subject: Re: [PATCH v3 12/16] x86/virt/tdx: Add helpers to allow for
pre-allocating pages
On Thu, Sep 18, 2025 at 04:22:20PM -0700, Rick Edgecombe wrote:
> In the KVM fault path pagei, tables and private pages need to be
Typo.
> installed under a spin lock. This means that the operations around
> installing PAMT pages for them will not be able to allocate pages.
>
> +static inline struct page *get_tdx_prealloc_page(struct tdx_prealloc *prealloc)
> +{
> + struct page *page;
> +
> + page = list_first_entry_or_null(&prealloc->page_list, struct page, lru);
> + if (page) {
> + list_del(&page->lru);
> + prealloc->cnt--;
> + }
> +
For prealloc->cnt == 0, kvm_mmu_memory_cache_alloc() does allocation
with GFP_ATOMIC after WARN().
Do we want the same here?
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists