Ultimately, the high-memory pages will be mapped temporarily into the
kernel address space.
Driver writers have the option of using a buffer in normal memory and
copy_to_user()/copy_from_user() functions to transfer data to/from
userspace. These functions hide the details of the virtual address
Alternatively the driver can use get_user_pages() to 'pin' the userspace
pages into memory and kmap() to get the kernel address of each page.
kmap() will return the fixed address of a normal page, or map a high
memory page into the kernel. The pages must be released afterwards with
kunmap() (a noop if the page is normal) and page_cache_release().
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds