From: Mike Frysinger <vapier@gentoo.org>
To: linux-ia64@vger.kernel.org
Subject: Re: getcpu() returns EFAULT when called via the vdso
Date: Tue, 08 May 2012 22:31:59 +0000 [thread overview]
Message-ID: <201205081832.01092.vapier@gentoo.org> (raw)
In-Reply-To: <201205061645.24398.vapier@gentoo.org>
[-- Attachment #1: Type: Text/Plain, Size: 907 bytes --]
On Tuesday 08 May 2012 17:13:28 Tony Luck wrote:
> On Mon, May 7, 2012 at 4:53 PM, Mike Frysinger wrote:
> > i guess that needs to load some p reg with a NULL pointer test and then
> > do the loads/stores based on that. calling getcpu(NULL, NULL, NULL)
> > from userspace shouldn't trigger EFAULT.
>
> We could do that (see attached, untested, patch). But it wouldn't help
> the sched_getcpu() code much ... it would stop getting -EFAULT, but
> it still wouldn't have the right return value.
wouldn't it though ? the return value with getcpu is just "0" when things
worked. if i do:
int i;
syscall(__NR_getcpu, &i, NULL, NULL);
this should return 0 and fill in "i" with the cpu value. i think your proposed
patch would make things work as no fault would be triggered, and the return
value (r8) would be set to 0.
i'll have to rebuild the kernel to double check though.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-05-08 22:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-06 20:45 getcpu() returns EFAULT when called via the vdso Mike Frysinger
2012-05-07 17:58 ` Luck, Tony
2012-05-07 23:12 ` Mike Frysinger
2012-05-07 23:53 ` Mike Frysinger
2012-05-08 21:13 ` Tony Luck
2012-05-08 22:31 ` Mike Frysinger [this message]
2012-05-15 5:41 ` Mike Frysinger
2012-11-29 23:34 ` Mike Frysinger
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=201205081832.01092.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=linux-ia64@vger.kernel.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