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

Re: [PATCH 2/6] KVM: mmu: also return page from gfn_to_pfn

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2021-06-24 09:58:07
Also in: dri-devel, intel-gfx, kvm, kvmarm, linux-arm-kernel, linux-mips, lkml

Excerpts from Paolo Bonzini's message of June 24, 2021 7:42 pm:
On 24/06/21 10:52, Nicholas Piggin wrote:
quoted
quoted
For now, wrap all calls to gfn_to_pfn functions in the new helper
function. Callers which don't need the page struct will be updated in
follow-up patches.
Hmm. You mean callers that do need the page will be updated? Normally
if there will be leftover users that don't need the struct page then
you would go the other way and keep the old call the same, and add a new
one (gfn_to_pfn_page) just for those that need it.
Needing kvm_pfn_page_unwrap is a sign that something might be buggy, so 
it's a good idea to move the short name to the common case and the ugly 
kvm_pfn_page_unwrap(gfn_to_pfn(...)) for the weird one.  In fact I'm not 
sure there should be any kvm_pfn_page_unwrap in the end.
If all callers were updated that is one thing, but from the changelog
it sounds like that would not happen and there would be some gfn_to_pfn
users left over.

But yes in the end you would either need to make gfn_to_pfn never return
a page found via follow_pte, or change all callers to the new way. If 
the plan is for the latter then I guess that's fine.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help