[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [LINUX] Mark /dev/mem regions as VM_PFNMAP.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Node ID eb7e5d95e7ea18b4209952e4ba9b8d50d79ba60b # Parent c09d6e997f058a826174c17d040576898dcab110 [LINUX] Mark /dev/mem regions as VM_PFNMAP. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c | 2 +- linux-2.6-xen-sparse/mm/memory.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff -r c09d6e997f05 -r eb7e5d95e7ea linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c --- a/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c Mon Aug 14 16:12:43 2006 +0100 +++ b/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c Mon Aug 14 16:35:49 2006 +0100 @@ -121,7 +121,7 @@ int direct_remap_pfn_range(struct vm_are domid_t domid) { /* Same as remap_pfn_range(). */ - vma->vm_flags |= VM_IO | VM_RESERVED; + vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; if (domid == DOMID_SELF) return -EINVAL; diff -r c09d6e997f05 -r eb7e5d95e7ea linux-2.6-xen-sparse/mm/memory.c --- a/linux-2.6-xen-sparse/mm/memory.c Mon Aug 14 16:12:43 2006 +0100 +++ b/linux-2.6-xen-sparse/mm/memory.c Mon Aug 14 16:35:49 2006 +0100 @@ -390,7 +390,7 @@ struct page *vm_normal_page(struct vm_ar if (vma->vm_flags & VM_PFNMAP) { unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT; - if (pfn == vma->vm_pgoff + off) + if ((pfn == vma->vm_pgoff + off) || !pfn_valid(pfn)) return NULL; if (!is_cow_mapping(vma->vm_flags)) return NULL; @@ -405,8 +405,7 @@ struct page *vm_normal_page(struct vm_ar * Remove this test eventually! */ if (unlikely(!pfn_valid(pfn))) { - if (!(vma->vm_flags & VM_RESERVED)) - print_bad_pte(vma, pte, addr); + print_bad_pte(vma, pte, addr); return NULL; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |