aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/page.h
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-12-12 12:14:56 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:27:08 -0500
commitbcd022801ee514e28c32837f0b3ce18c775f1a7b (patch)
tree6230fbec80e9f1c7580efa685ded26f638f81ef0 /include/asm-mips/page.h
parent9de455b20705f36384a711d4a20bcf7ba1ab180b (diff)
[PATCH] MIPS: Fix COW D-cache aliasing on fork
Provide a custom copy_user_highpage() to deal with aliasing issues on MIPS. It uses kmap_coherent() to map an user page for kernel with same color. Rewrite copy_to_user_page() and copy_from_user_page() with the new interfaces to avoid extra cache flushing. The main part of this patch was originally written by Ralf Baechle; Atushi Nemoto did the the debugging. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r--include/asm-mips/page.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 0dc1a45c27ed..2f9e1a9ec51f 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -35,7 +35,6 @@
35#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36 36
37#include <linux/pfn.h> 37#include <linux/pfn.h>
38#include <asm/cpu-features.h>
39#include <asm/io.h> 38#include <asm/io.h>
40 39
41extern void clear_page(void * page); 40extern void clear_page(void * page);
@@ -61,16 +60,13 @@ static inline void clear_user_page(void *addr, unsigned long vaddr,
61 flush_data_cache_page((unsigned long)addr); 60 flush_data_cache_page((unsigned long)addr);
62} 61}
63 62
64static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, 63extern void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
65 struct page *to) 64 struct page *to);
66{ 65struct vm_area_struct;
67 extern void (*flush_data_cache_page)(unsigned long addr); 66extern void copy_user_highpage(struct page *to, struct page *from,
67 unsigned long vaddr, struct vm_area_struct *vma);
68 68
69 copy_page(vto, vfrom); 69#define __HAVE_ARCH_COPY_USER_HIGHPAGE
70 if (!cpu_has_ic_fills_f_dc ||
71 pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
72 flush_data_cache_page((unsigned long)vto);
73}
74 70
75/* 71/*
76 * These are used to make use of C type-checking.. 72 * These are used to make use of C type-checking..