On Mon, Mar 18, 2024 at 02:10:55PM +0100, Paolo Bonzini wrote: > Another possibility is to have a double-underscore version that allows > FOLL_GET, and have the "clean" kvm_follow_pfn() forbid it. So you > would still have the possibility to convert to __kvm_follow_pfn() with > FOLL_GET first, and then when you remove the refcount you switch to > kvm_follow_pfn(). That does sound much better. Then again anything that actually wants pages (either for a good reason or historic reasons) really should be using get/pin_user_pages anyway and not use follow_pte.