From: Andrew Morton <akpm@osdl.org>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add likely around access_ok for uaccess
Date: Sun, 14 Sep 2003 12:30:24 -0700 [thread overview]
Message-ID: <20030914123024.4a261cd3.akpm@osdl.org> (raw)
In-Reply-To: <3F644E36.5010402@colorfullife.com>
Manfred Spraul <manfred@colorfullife.com> wrote:
>
> I noticed that gcc's autodetection (3.2.2) guesses
> the "if(access_ok())" tests in uaccess.h wrong and puts the error memset
> into the direct path and the copy out of line.
>
> The attached patch adds likely to the tests
Fair enough. There are quite a few other access_ok() callers. How
about just:
--- 25/include/asm-i386/uaccess.h~access_ok-is-likely 2003-09-14 12:29:10.000000000 -0700
+++ 25-akpm/include/asm-i386/uaccess.h 2003-09-14 12:29:24.000000000 -0700
@@ -80,7 +80,7 @@ extern struct movsl_mask {
* checks that the pointer is in the user space range - after calling
* this function, memory access functions may still return -EFAULT.
*/
-#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
/**
* verify_area: - Obsolete, use access_ok()
_
next prev parent reply other threads:[~2003-09-14 19:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-14 11:17 [PATCH] add likely around access_ok for uaccess Manfred Spraul
2003-09-14 19:30 ` Andrew Morton [this message]
2003-09-14 19:45 ` Manfred Spraul
2003-09-14 19:48 ` Manfred Spraul
2003-09-14 20:00 ` Andrew Morton
2003-09-15 22:59 ` David S. Miller
2003-09-16 19:49 ` Pavel Machek
2003-09-16 20:55 ` Jeff Garzik
2003-09-16 20:59 ` Pavel Machek
2003-09-17 16:57 ` Manfred Spraul
[not found] <vD5l.6Wt.19@gated-at.bofh.it>
2003-09-14 16:49 ` Andi Kleen
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=20030914123024.4a261cd3.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
/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