public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: akpm@osdl.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] consolidate sys_ptrace
Date: Wed, 10 Aug 2005 10:38:49 +0200	[thread overview]
Message-ID: <20050810083849.GA6285@lst.de> (raw)
In-Reply-To: <OF8987FA95.237C3BAD-ON42257059.002E0E68-42257059.002F0B40@de.ibm.com>

On Wed, Aug 10, 2005 at 10:33:50AM +0200, Martin Schwidefsky wrote:
> Christoph Hellwig <hch@lst.de> wrote on 08/10/2005 10:00:57 AM:
> 
> > The sys_ptrace boilerplate code (everything outside the big switch
> > statement for the arch-specific requests) is shared by most
> > architectures.  This patch moves it to kernel/ptrace.c and leaves the
> > arch-specific code as arch_ptrace.
> >
> > Some architectures have a too different ptrace so we have to exclude
> > them: alpha, ia64, m32r, parisc, sparc, sparc64.  They continue to
> > keep their implementations.  For sh64 I had to add a sh64_ptrace wrapper
> > because it does some initialization on the first call.  For um I removed
> > an ifdefed SUBARCH_PTRACE_SPECIAL block, but SUBARCH_PTRACE_SPECIAL
> > isn't defined anywhere in the tree.
> 
> There is one small problem with the new ptrace code for s390. We have
> this horribly broken ptrace hack to get the ieee instruction pointer
> of the last fpu exception. The fpu itself doesn't store the value so
> the exception handler of the kernel stores the instruction pointer to
> the thread structure. A process is allowed to ptrace itself (!) with the
> peek/poke value of PT_IEEE_IP to get this value. This is used in the
> fpu code in glibc. I know this is broken but I can't help it. Without
> this hack existing glibc code will fall over.
> 
> To make this work the special case needs to be dealt with before the
> ptrace_check_attach check is done. My suggestion would be to move the
> ptrace_check_attach to the arch_ptrace function. Then the s390 specific
> arch_ptrace function could insert the PT_IEEE_IP check before calling
> ptrace_chek_attach. The only other alternative is a s390 copy of
> sys_ptrace.

I suspect at this point it's better to leave s390 out of the
consolidation.  I'll have another patch that'll make the implementations
that aren't consolidated use the new ptrace_get_task_struct function,
so there will be far less code duplicated than now.

  reply	other threads:[~2005-08-10  8:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-10  8:00 [PATCH] consolidate sys_ptrace Christoph Hellwig
2005-08-10  8:33 ` Martin Schwidefsky
2005-08-10  8:38   ` Christoph Hellwig [this message]
2005-08-10  8:43 ` Andi Kleen
2005-08-10  9:36 ` David Howells
2005-08-10 12:46 ` Paul Mundt
2005-08-10 13:15 ` Ralf Baechle
2005-08-10 13:28 ` Jeff Dike
2005-08-10 17:08 ` Richard Henderson
2005-08-11 10:44 ` Roman Zippel
2005-08-11 13:51   ` Christoph Hellwig
2005-08-11 16:51 ` Russell King
2005-08-11 17:32 ` Richard Henderson
2005-08-11 17:33   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2005-08-10 16:59 Luck, Tony
2005-08-11  0:20 ` Stephen Rothwell
2005-11-01  5:09 [PATCH " Christoph Hellwig
2005-11-01  5:12 ` Christoph Hellwig
2005-11-01  9:58   ` Paul Mackerras
2005-11-01 10:30   ` Ralf Baechle
2005-11-01 11:37   ` David Howells
2005-11-02  4:31     ` Andrew Morton
2005-11-05  0:19     ` Christoph Hellwig
2005-11-01 18:12   ` Russell King
2005-11-02 11:21   ` Paul Mundt

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=20050810083849.GA6285@lst.de \
    --to=hch@lst.de \
    --cc=akpm@osdl.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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