All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	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 11:59:43 -0800	[thread overview]
Message-ID: <4951432F.3050701@ct.jp.nec.com> (raw)
In-Reply-To: <20081223143046.GD29151@elte.hu>

Ingo Molnar wrote:
> * 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 :)

thanks for the above explanation.
I felt it's very hard to understand GCC.

Thanks,
Hiroshi

  reply	other threads:[~2008-12-23 19:59 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
2008-12-23 19:59     ` Hiroshi Shimamoto [this message]
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=4951432F.3050701@ct.jp.nec.com \
    --to=h-shimamoto@ct.jp.nec.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.