Using do_page_fault for section fault handling
authorBill Carson <bill4carson@gmail.com>
Mon, 13 Feb 2012 09:44:26 +0000 (17:44 +0800)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 22 Sep 2012 21:40:03 +0000 (00:40 +0300)
Signed-off-by: Bill Carson <bill4carson@gmail.com>
arch/arm/mm/fault.c

index 4b0bc37..0ba09e5 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/sched.h>
 #include <linux/highmem.h>
 #include <linux/perf_event.h>
+#include <linux/hugetlb.h>
 
 #include <asm/exception.h>
 #include <asm/system.h>
@@ -471,6 +472,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
 }
 #endif                                 /* CONFIG_MMU */
 
+#ifndef CONFIG_ARM_HUGETLB_SUPPORT
 /*
  * Some section permission faults need to be handled gracefully.
  * They can happen due to a __{get,put}_user during an oops.
@@ -482,6 +484,19 @@ do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
        return 0;
 }
 
+#else
+
+/* Since normal 4K page based vma will never fault into section traps,
+ * This will enable us to use do_page_fault for section permission fault.
+ */
+static int
+do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
+{
+       do_page_fault(addr, fsr, regs);
+       return 0;
+}
+#endif
+
 /*
  * This abort handler always returns "fault".
  */