[patch 041/114] vmalloc: call flush_cache_vunmap() from unmap_kernel_range()

Greg KH
2009-03-14T01:35:22Z

[-- Attachment #1: vmalloc-call-flush_cache_vunmap-from-unmap_kernel_range.patch --]
[-- Type: text/plain, Size: 1017 bytes --]

2.6.28-stable review patch. If anyone has any objections, please let us know.

------------------

From: Tejun Heo <tj@kernel.org>

commit f6fcba7014f9cc535fa75ef98c008b24e49e2212 upstream.

Impact: proper vcache flush on unmap_kernel_range()

flush_cache_vunmap() should be called before pages are unmapped. Add
a call to it in unmap_kernel_range().

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Nick Piggin <npiggin@suse.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
mm/vmalloc.c | 2 ++
1 file changed, 2 insertions(+)

--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -997,6 +997,8 @@ void __init vmalloc_init(void)
void unmap_kernel_range(unsigned long addr, unsigned long size)
{
unsigned long end = addr + size;
+
+ flush_cache_vunmap(addr, end);
vunmap_page_range(addr, end);
flush_tlb_kernel_range(addr, end);
}