aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-09-23 15:54:05 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-11-09 16:04:29 -0500
commit0cfd8ac8e702db147a9a664212f597f627b3f7e9 (patch)
tree95e8098a6f1441886057dab9ebaa11b5aaea5316
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
downloadxen-0cfd8ac8e702db147a9a664212f597f627b3f7e9.tar.gz
xen/v86d: Fix /dev/mem to access memory below 1MB
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>
-rw-r--r--drivers/char/mem.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 8fc04b4f311f7..a1be5259aabbc 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -313,9 +313,14 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma)
&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;