On Fri, Aug 09, 2024, Peter Xu wrote:
Introduce a pair of APIs to follow pfn mappings to get entry information.
It's very similar to what follow_pte() does before, but different in that
it recognizes huge pfn mappings.
...
+int follow_pfnmap_start(struct follow_pfnmap_args *args);
+void follow_pfnmap_end(struct follow_pfnmap_args *args);
I find the start+end() terminology to be unintuitive. E.g. I had to look at the
implementation to understand why KVM invoke fixup_user_fault() if follow_pfnmap_start()
failed.
What about follow_pfnmap_and_lock()? And then maybe follow_pfnmap_unlock()?
Though that second one reads a little weird.