ia64/xen-unstable

changeset 7908:0970a2fdbee9

make_page_readonly() must flush unused kmaps when handling
a high-memory page. Otherwise stale writable mappings may
persist. This fixes a corner case for alloc_ldt (which can
vmalloc an LDT and hence use highmem pages).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Nov 18 17:50:25 2005 +0100 (2005-11-18)
parents 8b384e741382
children 378e1c58bcd2
files linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Nov 18 17:42:45 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Nov 18 17:50:25 2005 +0100
     1.3 @@ -409,7 +409,9 @@ void make_page_readonly(void *va)
     1.4  	if ((unsigned long)va >= (unsigned long)high_memory) {
     1.5  		unsigned long pfn = pte_pfn(*pte);
     1.6  #ifdef CONFIG_HIGHMEM
     1.7 -		if (pfn < highstart_pfn)
     1.8 +		if (pfn >= highstart_pfn)
     1.9 +			kmap_flush_unused(); /* flush stale writable kmaps */
    1.10 +		else
    1.11  #endif
    1.12  			make_lowmem_page_readonly(
    1.13  				phys_to_virt(pfn << PAGE_SHIFT));