From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: <linuxppc-dev@ozlabs.org>, <cbe-oss-dev@ozlabs.org>
Cc: Andrew Morton <akpm@osdl.org>, Arnd Bergmann <arnd.bergmann@de.ibm.com>
Subject: [PATCH 2/3] Add NOPFN_REFAULT result from vm_ops->nopfn()
Date: Wed, 07 Feb 2007 15:50:51 +1100 [thread overview]
Message-ID: <20070207045054.058B3DDECC@ozlabs.org> (raw)
In-Reply-To: <1170823850.450936.293648942401.qpush@grosgo>
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 <benh@kernel.crashing.org>
include/linux/mm.h | 1 +
mm/memory.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
Index: linux-cell/include/linux/mm.h
===================================================================
--- linux-cell.orig/include/linux/mm.h 2007-02-06 14:40:45.000000000 +1100
+++ linux-cell/include/linux/mm.h 2007-02-06 14:40:52.000000000 +1100
@@ -637,6 +637,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-cell/mm/memory.c
===================================================================
--- linux-cell.orig/mm/memory.c 2007-02-06 14:41:10.000000000 +1100
+++ linux-cell/mm/memory.c 2007-02-06 14:41:45.000000000 +1100
@@ -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);
next prev parent reply other threads:[~2007-02-07 4:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-07 4:50 [PATCH 0/3] spufs: don't need struct page for SPEs Benjamin Herrenschmidt
2007-02-07 4:50 ` [PATCH 1/3] add vm_insert_pfn() Benjamin Herrenschmidt
2007-02-07 4:50 ` Benjamin Herrenschmidt [this message]
2007-02-07 4:50 ` [PATCH 3/3] spufs: remove need for struct page for SPEs Benjamin Herrenschmidt
2007-02-07 4:55 ` Benjamin Herrenschmidt
2007-02-07 14:52 ` [Cbe-oss-dev] " Christoph Hellwig
2007-02-07 22:21 ` Andrew Morton
2007-02-07 23:15 ` Benjamin Herrenschmidt
2007-02-09 3:59 ` [Cbe-oss-dev] " Benjamin Herrenschmidt
2007-02-07 14:39 ` [PATCH 0/3] spufs: don't need " Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070207045054.058B3DDECC@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=arnd.bergmann@de.ibm.com \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).