Thanks for taking the time and sorry for the delay.
On 6. Apr 2017, at 16:22, Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx> wrote:
2017-04-05 15:07+0200, Filippo Sironi:
cmpxchg_gpte() calls get_user_pages_fast() to retrieve the number of
pages and the respective struct pages for mapping in the kernel virtual
address space.
This doesn't work if get_user_pages_fast() is invoked with a userspace
virtual address that's backed by PFNs outside of kernel reach (e.g.,
when limiting the kernel memory with mem= in the command line and using
/dev/mem to map memory).
If get_user_pages_fast() fails, look up the VMA that backs the userspace
virtual address, compute the PFN and the physical address, and map it in
the kernel virtual address space with memremap().
What is the reason for a configuration that voluntarily restricts access
to memory that it needs?
By using /dev/mem to provide VM memory, one can avoid the overhead of allocating struct page(s) for the whole memory, which is wasteful when using a server entirely for hosting VMs.