See also this answer: https://stackoverflow.com/a/10770582/1284631
I need something similar, but without having to allocate a buffer: the buffer is large, in theory, but the user space program only needs to access some parts of it, so a limited number of pages.
The question is:
What would be the body of the my_vm_ops.fault()
method and what page to return through vmf->page
? (it needs to allocate the needed page, but not from a pre-existing buffer)