Thread (34 messages) 34 messages, 6 authors, 2021-06-25

Re: [PATCH 0/6] KVM: Remove uses of struct page from x86 and arm64 MMU

flat view

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-06-24 15:35:34
Also in: dri-devel, intel-gfx, kvm, kvmarm, linux-mips, linuxppc-dev, lkml

On 24/06/21 14:57, Nicholas Piggin wrote:
KVM: Fix page ref underflow for regions with valid but non-refcounted pages
It doesn't really fix the underflow, it disallows mapping them in the first place.  Since in principle things can break, I'd rather be explicit, so let's go with "KVM: do not allow mapping valid but non-reference-counted pages".
It's possible to create a region which maps valid but non-refcounted
pages (e.g., tail pages of non-compound higher order allocations). These
host pages can then be returned by gfn_to_page, gfn_to_pfn, etc., family
of APIs, which take a reference to the page, which takes it from 0 to 1.
When the reference is dropped, this will free the page incorrectly.

Fix this by only taking a reference on the page if it was non-zero,
s/on the page/on valid pages/ (makes clear that invalid pages are fine without refcounting).

Thank you *so* much, I'm awful at Linux mm.

Paolo
which indicates it is participating in normal refcounting (and can be
released with put_page).

Signed-off-by: Nicholas Piggin<npiggin@gmail.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help