[PATCH] uml-v2.6.12-bcrl-fix-tlb.diff

From: Benjamin LaHaise
Date: Tue Jul 05 2005 - 13:42:50 EST


Hello all,

This patch fixes a fairly serious tlb flushing bug that makes aio use under
uml very unreliable -- SEGVs, Oops and panic()s occur as a result of stale
tlb entires being used by uml when aio switches mms due to the fact that
uml does not implement the activate_mm() hook. This patch introduces a
simple but correct approach (read: hammer) for implementing activate_mm()
in uml by doing a force_flush_all() if the new mm is different from old.
With this patch in place, uml is able to succeed at the aio test case that
was randomly faulting for me before.

-ben

diff -purN 60_pipe_aio/include/asm-um/mmu_context.h test.diff/include/asm-um/mmu_context.h
--- 60_pipe_aio/include/asm-um/mmu_context.h 2004-12-24 16:34:57.000000000 -0500
+++ test.diff/include/asm-um/mmu_context.h 2005-07-05 14:38:34.569235552 -0400
@@ -14,8 +14,12 @@

#define deactivate_mm(tsk,mm) do { } while (0)

+extern void force_flush_all(void);
+
static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
{
+ if (old != new)
+ force_flush_all();
}

extern void switch_mm_skas(int mm_fd);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/