From: Ingo Molnar <mingo@elte.hu>
To: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [RFC -tip 2/4] x86: uaccess: introduce __{get|put}_user exception handling framework
Date: Tue, 23 Dec 2008 15:30:46 +0100 [thread overview]
Message-ID: <20081223143046.GD29151@elte.hu> (raw)
In-Reply-To: <495075B0.9020104@ct.jp.nec.com>
* Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> wrote:
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
>
> Impact: introduce new framework
>
> Introduce exception handling framework.
> __{get|put}_user_ex_try() begins exception block and
> __{get|put}_user_ex_catch() ends block and if an exception occurred in this
> block using __{get|put}_user_ex, direct jump to __{get|put}_user_ex_catch()
> and err is set to specified value.
ha, this tickled ~12 year old memories: back then Linus came up with a
very, very similar scheme, for user-copy exception handling.
Such a scheme would be elegant, creates more compact code (we can use
conditional results directly in branch instructions instead of having to
export them into registers), and it makes sense syntactically, but it
doesnt work: GCC is free to reorder (or eliminate) basic blocks and these
labels can lose their relationship.
So this cannot be done via inline assembly right now, it needs some
compiler help. Sniff :)
Ingo
next prev parent reply other threads:[~2008-12-23 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-23 5:20 [RFC -tip 0/4] x86: improve uaccess in signal Hiroshi Shimamoto
2008-12-23 5:22 ` [RFC -tip 1/4] x86: uaccess: rename __put_user_u64() to __put_user_asm_u64() Hiroshi Shimamoto
2008-12-23 5:22 ` [RFC -tip 2/4] x86: uaccess: introduce __{get|put}_user exception handling framework Hiroshi Shimamoto
2008-12-23 5:38 ` Brian Gerst
2008-12-23 5:47 ` Hiroshi Shimamoto
2008-12-23 14:30 ` Ingo Molnar [this message]
2008-12-23 19:59 ` Hiroshi Shimamoto
2008-12-23 5:23 ` [RFC -tip 3/4] x86: signal: use " Hiroshi Shimamoto
2008-12-23 5:24 ` [RFC -tip 4/4] x86: ia32_signal: " Hiroshi Shimamoto
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=20081223143046.GD29151@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=h-shimamoto@ct.jp.nec.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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