Patchwork [2/5] (pre-stable) mm: Fix fixup_user_fault() for MMU=n

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date Dec. 3, 2011, 12:55 a.m.
Message ID <1322873716-22760-3-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/129003/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - Dec. 3, 2011, 12:55 a.m.
From: Peter Zijlstra <peterz@infradead.org>

In commit 2efaca927f5c ("mm/futex: fix futex writes on archs with SW
tracking of dirty & young") we forgot about MMU=n.  This patch fixes
that.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: David Howells <dhowells@redhat.com>
Link: http://lkml.kernel.org/r/1311761831.24752.413.camel@twins
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
BugLink: http://bugs.launchpad.net/bugs/898139
(cherry-picked from commit 5c723ba5b7886909b2e430f2eae454c33f7fe5c6 upstream)
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 include/linux/mm.h |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index cac9205..1b19547 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -830,6 +830,8 @@  int invalidate_inode_page(struct page *page);
 #ifdef CONFIG_MMU
 extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 			unsigned long address, unsigned int flags);
+extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
+			    unsigned long address, unsigned int fault_flags);
 #else
 static inline int handle_mm_fault(struct mm_struct *mm,
 			struct vm_area_struct *vma, unsigned long address,
@@ -839,6 +841,14 @@  static inline int handle_mm_fault(struct mm_struct *mm,
 	BUG();
 	return VM_FAULT_SIGBUS;
 }
+static inline int fixup_user_fault(struct task_struct *tsk,
+		struct mm_struct *mm, unsigned long address,
+		unsigned int fault_flags)
+{
+	/* should never happen if there's no MMU */
+	BUG();
+	return -EFAULT;
+}
 #endif
 
 extern int make_pages_present(unsigned long addr, unsigned long end);
@@ -850,8 +860,6 @@  int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 			struct page **pages);
 struct page *get_dump_page(unsigned long addr);
-extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
-			    unsigned long address, unsigned int fault_flags);
 
 extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
 extern void do_invalidatepage(struct page *page, unsigned long offset);