We need to provide the VM_IO (and _PAGE_IOMAP) to see the contents
of the memory below 1MB.
Reported-and-Tested-by: Ben Guthro <ben.guthro@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
&vma->vm_page_prot))
return -EINVAL;
- vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff,
- size,
- vma->vm_page_prot);
+ vma->vm_flags |= VM_RESERVED | VM_IO | VM_PFNMAP | VM_DONTEXPAND;
+ vma->vm_page_prot = __pgprot(
+ pgprot_val(vm_get_page_prot(vma->vm_flags)) |
+ _PAGE_IOMAP |
+ pgprot_val(phys_mem_access_prot(file,
+ vma->vm_pgoff,
+ size,
+ vma->vm_page_prot)));
vma->vm_ops = &mmap_mem_ops;