mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Veaceslav Falico <vfalico@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	"Frank Ch. Eigler" <fche@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, utrace-devel@redhat.com,
	Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: powerpc: syscall_dotrace() && retcode (Was: powerpc: fork && stepping)
Date: Tue,  1 Dec 2009 11:27:50 -0800 (PST)	[thread overview]
Message-ID: <20091201192750.4A1291DE@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Monday, 30 November 2009 21:01:36 +0100 <20091130200136.GB11764@redhat.com>

We don't really intend to impose any new requirements on the arch behavior
here.  It's up to the arch folks to decide.  It does simplify life somewhat
on x86 that you can change the registers at the syscall-entry stop and then
after skipping the syscall, those registers will be unchanged from what you
set.  But it's never been that way on every other arch, and it doesn't need
to be.  The arch requirement on the tracehook_report_syscall_entry() return
value handling is that it make the syscall not be run, and that the
register state then left be compatible with using syscall_rollback() at the
tracehook_report_syscall_exit() spot.

As to what you get from ptrace explicitly fiddling with registers at
syscall entry, that has always been arch-specific before and we haven't
done anything to change that situation.  On every arch, there is some way
to change the syscall number to be run, and changing it to a known-bogus
number (e.g. -1) makes sure no syscall runs.  On every arch, it's possible
at the tracehook_report_syscall_exit() spot to change the registers to
exactly whatever you want userland to see.  That's enough as it stands to
make it possible to do whatever you want, some way or other.

If the powerpc maintainers want to change the behavior here, that is fine
by me.  But there is no need for that just to satisfy general ptrace
cleanups (or utrace).  Normal concerns require that no such change break
the ptrace behavior that userland could have relied on in the past.

So off hand I don't see a reason to change at all.  If every arch were to
change so that registers changed at syscall-entry were left unmolested by
aborting the syscall, then that might be a new consistency worth having.
But short of that, I don't really see a benefit.

All this implies that the ptrace-tests case relating to this needs to be
tailored differently for powerpc and each other arch so it expects and
verifies exactly the arch-specific behavior that's been seen in the past.


Thanks,
Roland

  reply	other threads:[~2009-12-01 19:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24 20:01 [RFC,PATCH 0/14] utrace/ptrace Oleg Nesterov
2009-11-25  8:03 ` Ananth N Mavinakayanahalli
2009-11-25 15:40   ` Oleg Nesterov
2009-11-26  7:53     ` Ananth N Mavinakayanahalli
2009-11-26 14:50       ` powerpc: fork && stepping (Was: [RFC,PATCH 0/14] utrace/ptrace) Oleg Nesterov
2009-11-26 17:25         ` Oleg Nesterov
2009-11-26 18:22           ` Veaceslav Falico
2009-11-26 20:23             ` Oleg Nesterov
2009-11-26 21:04               ` Oleg Nesterov
2009-11-26 21:53               ` Paul Mackerras
2009-11-26 22:37                 ` Oleg Nesterov
2009-11-27 17:46                   ` Veaceslav Falico
2009-11-28  7:30                     ` Ananth N Mavinakayanahalli
2009-11-29 21:07                       ` powerpc: syscall_dotrace() && retcode (Was: powerpc: fork && stepping) Oleg Nesterov
2009-11-29 23:15                         ` Benjamin Herrenschmidt
2009-11-30  0:43                           ` Benjamin Herrenschmidt
2009-11-30 20:00                             ` Oleg Nesterov
2009-11-30 20:01                           ` Oleg Nesterov
2009-12-01 19:27                             ` Roland McGrath [this message]
2009-12-01 20:17                               ` Benjamin Herrenschmidt
2009-11-26 22:40                 ` powerpc: fork && stepping (Was: [RFC,PATCH 0/14] utrace/ptrace) Andreas Schwab
2009-11-27  5:39         ` Ananth N Mavinakayanahalli
2009-11-27 15:05           ` Oleg Nesterov
2009-11-28  7:06             ` Ananth N Mavinakayanahalli
2009-11-25 21:48 ` [RFC,PATCH 0/14] utrace/ptrace Christoph Hellwig
2009-11-25 22:28   ` Oleg Nesterov
2009-11-26  7:07   ` Srikar Dronamraju
2009-11-26 12:55     ` Peter Zijlstra
2009-11-26  9:10   ` Ingo Molnar
2009-11-26 10:47     ` Christoph Hellwig
2009-11-26 12:24       ` Ingo Molnar
2009-11-27 14:04         ` Christoph Hellwig
2009-11-27 14:17           ` Oleg Nesterov
2009-11-27 19:16           ` Ingo Molnar
2009-11-26 14:27       ` Oleg Nesterov
2009-12-02  0:46         ` Roland McGrath
2009-11-29  8:59   ` Pavel Machek

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=20091201192750.4A1291DE@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=adobriyan@gmail.com \
    --cc=ananth@in.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=fche@redhat.com \
    --cc=hch@infradead.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=utrace-devel@redhat.com \
    --cc=vfalico@redhat.com \
    /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®