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

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

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-06-24 10:21:11
Also in: dri-devel, intel-gfx, kvm, kvmarm, linux-arm-kernel, linux-mips, lkml

On 24/06/21 12:17, Nicholas Piggin wrote:
quoted
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.
Actually in that case anyway I don't see the need -- the existence of
gfn_to_pfn is enough to know it might be buggy. It can just as easily
be grepped for as kvm_pfn_page_unwrap.
Sure, but that would leave us with longer function names 
(gfn_to_pfn_page* instead of gfn_to_pfn*).  So the "safe" use is the one 
that looks worse and the unsafe use is the one that looks safe.
And are gfn_to_page cases also
vulernable to the same issue?
No, they're just broken for the VM_IO|VM_PFNMAP case.

Paolo
So I think it could be marked deprecated or something if not everything
will be converted in the one series, and don't need to touch all that
arch code with this patch.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help