From: Linus Torvalds <torvalds@linux-foundation.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickens <hugh@veritas.com>
Subject: Re: [GIT PULL] x86/paravirt for v2.6.33
Date: Wed, 9 Dec 2009 10:38:51 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.0912091032380.3560@localhost.localdomain> (raw)
In-Reply-To: <wqm7jny7wc4aessgbtsgv0bw.1260383370120@email.android.com>
On Wed, 9 Dec 2009, H. Peter Anvin wrote:
> "Jeremy Fitzhardinge" <jeremy@goop.org> wrote:
> >
> >But I'm not sure I understand the objection to task_pt_regs(); is it
> >considered deprecated? This patch received quite a lot of discussion
> >with no mention of it. Should we consider all its uses as suspect?
I personally would be much happier without ever seeing a single
task_pt_regs() call outside of pure ptrace() users (and quite frankly,
even there I'd be happier if it was basically done once, and then 'struct
pt_regs' being passed around as an argument as much as possible).
In the case of 'ptrace' we control the stack of the tracee.
In other cases, we do _not_.
For example, think about us ever implementing 'tasklets' or async system
calls in general. It's _very_ possible that we'd have a special stolen
stack for them, and run the low-level system call function from that
stack. Then something like task_pt_regs() migth very well do the wrong
thing.
Now, I'm not saying that 'sys_iopl()' would ever be a valid target for
async system calls, but I _am_ saying that system calls that depend on
task_pt_regs() are fundamnetally fragile and broken, and have subtle
interactions.
In contrast, if you make it very explicit that the system call gets passed
a pointer to its pt_regs, then it still has all the same issues, but now
it's not subtle any more - now it's explicitly encoded in the call
sequence on both the caller and callee sides, and somebody doing tasklets
would hopefully see that "oh, iopl() has that same special thing that
fork/clone/vfork/execve has, and touches the stack frame register set
explicitly".
Linus
next prev parent reply other threads:[~2009-12-09 18:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-09 18:29 H. Peter Anvin
2009-12-09 18:38 ` Linus Torvalds [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-12-03 21:09 Ingo Molnar
2009-12-08 21:34 ` Linus Torvalds
2009-12-09 7:36 ` Ingo Molnar
2009-12-09 18:19 ` Jeremy Fitzhardinge
2009-12-09 18:31 ` Jeremy Fitzhardinge
2009-12-09 18:47 ` Linus Torvalds
2009-12-09 18:54 ` H. Peter Anvin
2009-12-09 19:08 ` Linus Torvalds
2009-12-09 19:25 ` Brian Gerst
2009-12-09 19:35 ` H. Peter Anvin
2009-12-09 19:32 ` Jeremy Fitzhardinge
2009-12-09 20:05 ` H. Peter Anvin
2009-12-09 18:49 ` H. Peter Anvin
2009-12-09 18:18 ` Jeremy Fitzhardinge
2009-12-09 21:58 ` Linus Torvalds
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=alpine.LFD.2.00.0912091032380.3560@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=hugh@veritas.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
Powered by JetHome