From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: blaisorblade@yahoo.it, akpm@osdl.org, jdike@addtoit.com,
linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net, mingo@elte.hu
Subject: Re: [patch 18/39] remap_file_pages protection support: add VM_FAULT_SIGSEGV
Date: Mon, 15 Aug 2005 20:12:54 +1000 [thread overview]
Message-ID: <43006AA6.1040405@yahoo.com.au> (raw)
In-Reply-To: <20050815104022.D19811@flint.arm.linux.org.uk>
Russell King wrote:
> On Fri, Aug 12, 2005 at 08:21:45PM +0200, blaisorblade@yahoo.it wrote:
>
>>@@ -632,10 +632,11 @@ static inline int page_mapped(struct pag
>> * Used to decide whether a process gets delivered SIGBUS or
>> * just gets major/minor fault counters bumped up.
>> */
>>-#define VM_FAULT_OOM (-1)
>>-#define VM_FAULT_SIGBUS 0
>>-#define VM_FAULT_MINOR 1
>>-#define VM_FAULT_MAJOR 2
>>+#define VM_FAULT_OOM (-1)
>>+#define VM_FAULT_SIGBUS 0
>>+#define VM_FAULT_MINOR 1
>>+#define VM_FAULT_MAJOR 2
>>+#define VM_FAULT_SIGSEGV 3
>>
>> #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
>>
>
>
> Please arrange for "success" values to be numerically larger than "failure"
> values. This will avoid breaking ARM.
>
> Is there a reason why we don't use -ve numbers for failure and +ve for
> success here?
>
Well there is now, and that is we are now using a bit in the 2nd
byte as flags. So I had to do away with -ve numbers there entirely.
You could achieve a similar thing by using another bit in that byte
#define VM_FAULT_FAILED 0x20
and make that bit present in VM_FAULT_OOM and VM_FAULT_SIGBUS, then
do an unlikely test for that bit in your handler and branch away to
the slow path.
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2005-08-15 10:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-12 18:21 [patch 18/39] remap_file_pages protection support: add VM_FAULT_SIGSEGV blaisorblade
2005-08-15 9:40 ` Russell King
2005-08-15 10:12 ` Nick Piggin [this message]
2005-08-15 10:15 ` Russell King
2005-08-15 10:25 ` Russell King
2005-08-23 8:45 ` Blaisorblade
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=43006AA6.1040405@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=blaisorblade@yahoo.it \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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