ia64/xen-unstable

changeset 11110:eb7e5d95e7ea

[LINUX] Mark /dev/mem regions as VM_PFNMAP.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Aug 14 16:35:49 2006 +0100 (2006-08-14)
parents c09d6e997f05
children 2afc3f16ae6e
files linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c linux-2.6-xen-sparse/mm/memory.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c	Mon Aug 14 16:12:43 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c	Mon Aug 14 16:35:49 2006 +0100
     1.3 @@ -121,7 +121,7 @@ int direct_remap_pfn_range(struct vm_are
     1.4  			   domid_t  domid)
     1.5  {
     1.6  	/* Same as remap_pfn_range(). */
     1.7 -	vma->vm_flags |= VM_IO | VM_RESERVED;
     1.8 +	vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
     1.9  
    1.10  	if (domid == DOMID_SELF)
    1.11  		return -EINVAL;
     2.1 --- a/linux-2.6-xen-sparse/mm/memory.c	Mon Aug 14 16:12:43 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/mm/memory.c	Mon Aug 14 16:35:49 2006 +0100
     2.3 @@ -390,7 +390,7 @@ struct page *vm_normal_page(struct vm_ar
     2.4  
     2.5  	if (vma->vm_flags & VM_PFNMAP) {
     2.6  		unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;
     2.7 -		if (pfn == vma->vm_pgoff + off)
     2.8 +		if ((pfn == vma->vm_pgoff + off) || !pfn_valid(pfn))
     2.9  			return NULL;
    2.10  		if (!is_cow_mapping(vma->vm_flags))
    2.11  			return NULL;
    2.12 @@ -405,8 +405,7 @@ struct page *vm_normal_page(struct vm_ar
    2.13  	 * Remove this test eventually!
    2.14  	 */
    2.15  	if (unlikely(!pfn_valid(pfn))) {
    2.16 -		if (!(vma->vm_flags & VM_RESERVED))
    2.17 -			print_bad_pte(vma, pte, addr);
    2.18 +		print_bad_pte(vma, pte, addr);
    2.19  		return NULL;
    2.20  	}
    2.21