I think it makes sense to have a generic (non-GUP) version of
check_and_migrate_movable_pages() available in migration.h that
drivers can use to ensure that they don't break memory hotunplug
accidentally.
Definately not.
Either use the VMA and pin_user_pages(), or implement
pin_user_pages_fd() in core code.
Do not open code something wonky in drivers.
Agreed. pin_user_pages_fd() might become relevant in the context of
vfio/mdev + KVM gmem -- don't mmap guest memory but instead provide it
via a special memfd to the kernel.
So there might be value in having such a core infrastructure.
--
Cheers,
David / dhildenb