[parisc-linux] Re: RFC: mmap patch

David S. Miller davem@redhat.com
Sun, 09 Mar 2003 13:31:28 -0800 (PST)


   From: John Marvin <jsm@udlkern.fc.hp.com>
   Date: Sat, 8 Mar 2003 20:51:55 -0700 (MST)

   The tlb trick for clear_user_page is already implemented. The code for
   copy_user_page is there, but turned off due to an issue mentioned in my
   last email. I believe the failure case was not a frequent path, and there
   are ways of working around that problem.
   
Fix it by adding a thread flag, "TIF_NEED_ICACHE_FLUSH" or whatever,
and at the end of copy_user_page() if this bit is set you flush the
page from the destination instruction cache.

The flag is set in do_parisc_fault() if the fault is for a write
and:

	((vma->vm_flags & VM_EXEC) != 0 &&
	 vma->vm_file != NULL)

See the TIF_BLKCOMMIT logic in arch/sparc64/mm/fault.c