mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@redhat.com>,
	Andrew Cagney <cagney@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] x86 single-step (TF) vs system calls & traps
Date: Thu, 1 Jul 2004 01:09:24 -0700	[thread overview]
Message-ID: <200407010809.i6189O6O019944@magilla.sf.frob.com> (raw)
In-Reply-To: Linus Torvalds's message of  Monday, 28 June 2004 22:15:51 -0700 <Pine.LNX.4.58.0406282209070.28764@ppc970.osdl.org>

> They are "user-mode" only in theory.

And in every practical sense that userland ever contemplates code, except
its supplier.  When you take an asynchronous signal, your PC value might be
anywhere in the middle of the code; even when you take a synchronous signal
produced inside the system call, your PC value will be somewhere in the
middle of the code.  Hence the need for the vsyscall DSO with unwind
information.  The code does memory accesses via your stack pointer to your
normal memory, and these can fault or overflow in all the normal ways.  I
just can't see the basis for an argument that it "makes more sense" for
single-stepping these instructions to work differently than others.

Now, if single-stepping the call to the vsyscall entry point treated the
whole thing as an atomic unit and came immediately out the other side to
the return-address of that call, then we would be on the same page.  That's
actually pretty damn easy to implement with a special case for the vsyscall
PC address in do_debug.  But it would be inconsistent with the fact that
signals don't also automagically roll your PC back or forward out of the
vsyscall code section.  If we made the vsyscall entry point code truly
"virtually atomic", then I would be 100% with you on calling it "kernel code".
I somehow doubt that is what you want to do.  

That said, I don't really know why you would object to the change I've
suggested to do_debug.  It only adds code when the case of single-stepping
into sysenter actually happens.


Thanks,
Roland


      reply	other threads:[~2004-07-01  8:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-29  1:55 Roland McGrath
2004-06-29  2:05 ` Davide Libenzi
2004-06-29  3:42 ` Linus Torvalds
2004-06-29  3:46   ` Roland McGrath
2004-06-29  3:55     ` Linus Torvalds
2004-06-29  4:15       ` Andrew Morton
2004-06-29  4:37         ` Roland McGrath
2004-06-29  7:00           ` Davide Libenzi
2004-07-01  7:47             ` Roland McGrath
2004-07-01 15:14               ` Davide Libenzi
2004-07-01 20:24                 ` Roland McGrath
2004-07-01 21:47                   ` Davide Libenzi
2004-07-01 20:34               ` Daniel Jacobowitz
2004-07-01 21:59                 ` Roland McGrath
2004-07-02  4:22                   ` Daniel Jacobowitz
2004-06-29  4:32       ` Roland McGrath
2004-06-29  5:15         ` Linus Torvalds
2004-07-01  8:09           ` Roland McGrath [this message]

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=200407010809.i6189O6O019944@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=cagney@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®