direct-io.hg

changeset 13393:84b7639a3bd4

linux/i386: enhance dump_fault_path() in the highpte case

As long as the pte page isn't really located in highmem, there is no
reason to not access it, in order to print the complete page table
hierarchy. A functionally similar patch will go to lkml for native
Linux.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Wed Jan 17 14:45:00 2007 +0000 (2007-01-17)
parents 0fd65225e4c6
children 3dcd2664853a
files linux-2.6-xen-sparse/arch/i386/mm/fault-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/fault-xen.c	Wed Jan 17 14:37:45 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/fault-xen.c	Wed Jan 17 14:45:00 2007 +0000
     1.3 @@ -232,9 +232,12 @@ static void dump_fault_path(unsigned lon
     1.4  		p += (address >> 21) * 2;
     1.5  		printk(KERN_ALERT "%08lx -> *pme = %08lx:%08lx\n", 
     1.6  		       page, p[1], p[0]);
     1.7 -#ifndef CONFIG_HIGHPTE
     1.8 +		mfn  = (p[0] >> PAGE_SHIFT) | (p[1] << 20);
     1.9 +#ifdef CONFIG_HIGHPTE
    1.10 +		if (mfn_to_pfn(mfn) >= highstart_pfn)
    1.11 +			return;
    1.12 +#endif
    1.13  		if (p[0] & 1) {
    1.14 -			mfn  = (p[0] >> PAGE_SHIFT) | (p[1] << 20);
    1.15  			page = mfn_to_pfn(mfn) << PAGE_SHIFT; 
    1.16  			p  = (unsigned long *) __va(page);
    1.17  			address &= 0x001fffff;
    1.18 @@ -242,7 +245,6 @@ static void dump_fault_path(unsigned lon
    1.19  			printk(KERN_ALERT "%08lx -> *pte = %08lx:%08lx\n",
    1.20  			       page, p[1], p[0]);
    1.21  		}
    1.22 -#endif
    1.23  	}
    1.24  }
    1.25  #else
    1.26 @@ -254,13 +256,16 @@ static void dump_fault_path(unsigned lon
    1.27  	page = ((unsigned long *) __va(page))[address >> 22];
    1.28  	printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page,
    1.29  	       machine_to_phys(page));
    1.30 +#ifdef CONFIG_HIGHPTE
    1.31  	/*
    1.32  	 * We must not directly access the pte in the highpte
    1.33 -	 * case, the page table might be allocated in highmem.
    1.34 +	 * case if the page table is located in highmem.
    1.35  	 * And lets rather not kmap-atomic the pte, just in case
    1.36  	 * it's allocated already.
    1.37  	 */
    1.38 -#ifndef CONFIG_HIGHPTE
    1.39 +	if ((page >> PAGE_SHIFT) >= highstart_pfn)
    1.40 +		return;
    1.41 +#endif
    1.42  	if (page & 1) {
    1.43  		page &= PAGE_MASK;
    1.44  		address &= 0x003ff000;
    1.45 @@ -269,7 +274,6 @@ static void dump_fault_path(unsigned lon
    1.46  		printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page,
    1.47  		       machine_to_phys(page));
    1.48  	}
    1.49 -#endif
    1.50  }
    1.51  #endif
    1.52