aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Michlmayr <tbm@cyrius.com>2007-03-24 16:02:50 +0000
committerMartin Michlmayr <tbm@cyrius.com>2007-03-24 16:02:50 +0000
commit41c94c97722b65b60bba71f83678a6cdfcf56595 (patch)
treee78bbf3514eb6ca63773ee4fffef317d67bca585
parent38242659dfc7dc44a0cbb12229e0586021450e4c (diff)
downloadkernel_replicant_linux-41c94c97722b65b60bba71f83678a6cdfcf56595.tar.gz
kernel_replicant_linux-41c94c97722b65b60bba71f83678a6cdfcf56595.tar.bz2
kernel_replicant_linux-41c94c97722b65b60bba71f83678a6cdfcf56595.zip
mips: Implement flush_anon_page() to fix data corruption issues
svn path=/dists/etch/linux-2.6/; revision=8391
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/bugfix/mips/flush_anon_page.patch102
-rw-r--r--debian/patches/series/121
3 files changed, 107 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 163ab83fd34e..335fd9ce8216 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,10 @@ linux-2.6 (2.6.18.dfsg.1-12) UNRELEASED; urgency=low
[ Bastian Blank ]
* xen: Fix highmem dma copy code. (closes: #415805)
+ [ Martin Michlmayr ]
+ * mips: Implement flush_anon_page() to fix data corruption issues
+ (Ralf Baechle).
+
-- Bastian Blank <waldi@debian.org> Sat, 24 Mar 2007 08:06:27 +0100
linux-2.6 (2.6.18.dfsg.1-11) unstable; urgency=low
diff --git a/debian/patches/bugfix/mips/flush_anon_page.patch b/debian/patches/bugfix/mips/flush_anon_page.patch
new file mode 100644
index 000000000000..bc5532a3b09a
--- /dev/null
+++ b/debian/patches/bugfix/mips/flush_anon_page.patch
@@ -0,0 +1,102 @@
+Author: Ralf Baechle <ralf@linux-mips.org> Fri Mar 23 21:36:37 2007 +0000
+Commit: 8f26705aefa297c71275e59fc46fbcadf80e0078
+Gitweb: http://www.linux-mips.org/g/linux/8f26705a
+Branch: linux-2.6.18-stable
+
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+(cherry picked from commit 2a58ce5784b74b09a4c306a60c3c3ba3f3376ee7)
+
+---
+
+ arch/mips/mm/cache.c | 16 +++++++++++++++-
+ arch/mips/mm/init.c | 4 ++--
+ include/asm-mips/cacheflush.h | 13 +++++++++++++
+ 3 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
+index f94e300..6244b8d 100644
+--- a/arch/mips/mm/cache.c
++++ b/arch/mips/mm/cache.c
+@@ -3,7 +3,8 @@
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+- * Copyright (C) 1994 - 2003 by Ralf Baechle
++ * Copyright (C) 1994 - 2003, 07 by Ralf Baechle (ralf@linux-mips.org)
++ * Copyright (C) 2007 MIPS Technologies, Inc.
+ */
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+@@ -89,6 +90,19 @@ void __flush_dcache_page(struct page *page)
+
+ EXPORT_SYMBOL(__flush_dcache_page);
+
++void __flush_anon_page(struct page *page, unsigned long vmaddr)
++{
++ if (pages_do_alias((unsigned long)page_address(page), vmaddr)) {
++ void *kaddr;
++
++ kaddr = kmap_coherent(page, vmaddr);
++ flush_data_cache_page((unsigned long)kaddr);
++ kunmap_coherent(kaddr);
++ }
++}
++
++EXPORT_SYMBOL(__flush_anon_page);
++
+ void __update_cache(struct vm_area_struct *vma, unsigned long address,
+ pte_t pte)
+ {
+diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
+index b3d3aee..965870b 100644
+--- a/arch/mips/mm/init.c
++++ b/arch/mips/mm/init.c
+@@ -130,7 +130,7 @@ static void __init kmap_coherent_init(void)
+ static inline void kmap_coherent_init(void) {}
+ #endif
+
+-static inline void *kmap_coherent(struct page *page, unsigned long addr)
++void *kmap_coherent(struct page *page, unsigned long addr)
+ {
+ enum fixed_addresses idx;
+ unsigned long vaddr, flags, entrylo;
+@@ -184,7 +184,7 @@ static inline void *kmap_coherent(struct page *page, unsigned long addr)
+
+ #define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
+
+-static inline void kunmap_coherent(struct page *page)
++void kunmap_coherent(struct page *page)
+ {
+ #ifndef CONFIG_MIPS_MT_SMTC
+ unsigned int wired;
+diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
+index d10517c..d45c2bc 100644
+--- a/include/asm-mips/cacheflush.h
++++ b/include/asm-mips/cacheflush.h
+@@ -46,8 +46,18 @@ static inline void flush_dcache_page(struct page *page)
+ #define flush_dcache_mmap_lock(mapping) do { } while (0)
+ #define flush_dcache_mmap_unlock(mapping) do { } while (0)
+
++#define ARCH_HAS_FLUSH_ANON_PAGE
++static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
++{
++ extern void __flush_anon_page(struct page *, unsigned long);
++
++ if (cpu_has_dc_aliases && PageAnon(page))
++ __flush_anon_page(page, vmaddr);
++}
++
+ extern void (*__flush_icache_page)(struct vm_area_struct *vma,
+ struct page *page);
++
+ static inline void flush_icache_page(struct vm_area_struct *vma,
+ struct page *page)
+ {
+@@ -86,4 +96,7 @@ extern void (*flush_data_cache_page)(unsigned long addr);
+ /* Run kernel code uncached, useful for cache probing functions. */
+ unsigned long __init run_uncached(void *func);
+
++extern void *kmap_coherent(struct page *page, unsigned long addr);
++extern void kunmap_coherent(struct page *page);
++
+ #endif /* _ASM_CACHEFLUSH_H */
diff --git a/debian/patches/series/12 b/debian/patches/series/12
index 39c60a54750b..5aac36599f34 100644
--- a/debian/patches/series/12
+++ b/debian/patches/series/12
@@ -7,3 +7,4 @@
+ bugfix/ipv6_getsockopt_sticky-null-opt.patch
+ bugfix/sparc/tcp-sendmsg-t12k-oops-fix.patch
+ bugfix/bnx2_tx_avail-off-by-1-fix.patch
++ bugfix/mips/flush_anon_page.patch