linux-mips
[Top] [All Lists]

Re: flush_kernel_vmap_range() invalidate_kernel_vmap_range() API not exi

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: flush_kernel_vmap_range() invalidate_kernel_vmap_range() API not exists for MIPS
From: Sergei Shtylyov <sshtylyov@mvista.com>
Date: Sat, 18 Jun 2011 17:06:37 +0400
Cc: Christoph Hellwig <hch@lst.de>, naveen yadav <yad.naveen@gmail.com>, linux-mips@linux-mips.org
In-reply-to: <20110617152028.GA14107@linux-mips.org>
References: <AANLkTimkh2QLvupu+62NGrKfqRb_gC7KLCAKkEoS9N9N@mail.gmail.com> <20110325172709.GC8483@linux-mips.org> <BANLkTimo6BEgDnTh+sPVR+MELyxiwJoFGw@mail.gmail.com> <20110616180250.GA13025@lst.de> <20110617152028.GA14107@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
Hello.

On 17-06-2011 19:20, Ralf Baechle wrote:

Ralf,

I'll second that request.  We'll really need this, right now embedded XFS
users are hacking around it in horrible ways.

Here's my shot at the problem.  I don't have the time to setup a XFS
filesystem and tools for testing before the weekend so all I claim is this
patch builds for R4000-class CPUs but it should be pretty close to the
real thing.

Naveen, can you give this patch a spin?  Thanks!

   Ralf

Signed-off-by: Ralf Baechle<ralf@linux-mips.org>

[...]

diff --git a/arch/mips/include/asm/cacheflush.h 
b/arch/mips/include/asm/cacheflush.h
index 40bb9fd..69468de 100644
--- a/arch/mips/include/asm/cacheflush.h
+++ b/arch/mips/include/asm/cacheflush.h
@@ -114,4 +114,28 @@ unsigned long run_uncached(void *func);
  extern void *kmap_coherent(struct page *page, unsigned long addr);
  extern void kunmap_coherent(void);

+#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+static inline void flush_kernel_dcache_page(struct page *page)
+{
+       BUG_ON(cpu_has_dc_aliases&&  PageHighMem(page));
+}
+
+/*
+ * For now flush_kernel_vmap_range and invalidate_kernel_vmap_range both do a
+ * cache writeback and invalidate operation.
+ */
+extern void (*__flush_kernel_vmap_range)(unsigned long vaddr, int size);
+
+static inline void flush_kernel_vmap_range(void *vaddr, int size)
+{
+       if (cpu_has_dc_aliases)
+               __flush_kernel_vmap_range((unsigned long) vaddr, size);
+}
+
+static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
+{
+       if (cpu_has_dc_aliases)
+               __flush_kernel_vmap_range((unsigned long) vaddr, size);

   Not __invalidate_kernel_vmap_range()?

WBR, Sergei

<Prev in Thread] Current Thread [Next in Thread>