Subject: Add NOPFN_REFAULT result from vm_ops->nopfn() From: Benjamin Herrenschmidt Add a NOPFN_REFAULT return code for vm_ops->nopfn() equivalent to NOPAGE_REFAULT for vmops->nopage() indicating that the handler requests a re-execution of the faulting instruction Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Arnd Bergmann --- include/linux/mm.h | 1 + mm/memory.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) Index: linux-2.6/include/linux/mm.h =================================================================== --- linux-2.6.orig/include/linux/mm.h +++ linux-2.6/include/linux/mm.h @@ -638,6 +638,7 @@ static inline int page_mapped(struct pag */ #define NOPFN_SIGBUS ((unsigned long) -1) #define NOPFN_OOM ((unsigned long) -2) +#define NOPFN_REFAULT ((unsigned long) -3) /* * Different kinds of faults, as returned by handle_mm_fault(). Index: linux-2.6/mm/memory.c =================================================================== --- linux-2.6.orig/mm/memory.c +++ linux-2.6/mm/memory.c @@ -2357,10 +2357,12 @@ static noinline int do_no_pfn(struct mm_ BUG_ON(is_cow_mapping(vma->vm_flags)); pfn = vma->vm_ops->nopfn(vma, address & PAGE_MASK); - if (pfn == NOPFN_OOM) + if (unlikely(pfn == NOPFN_OOM)) return VM_FAULT_OOM; - if (pfn == NOPFN_SIGBUS) + else if (unlikely(pfn == NOPFN_SIGBUS)) return VM_FAULT_SIGBUS; + else if (unlikely(pfn == NOPFN_REFAULT)) + return VM_FAULT_MINOR; page_table = pte_offset_map_lock(mm, pmd, address, &ptl);