mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Victor Zandy <zandy@cs.wisc.edu>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Backport of 2.4 ptrace flag to 2.2
Date: 11 May 2001 13:26:50 -0500	[thread overview]
Message-ID: <cpxeltvoi6t.fsf@goat.cs.wisc.edu> (raw)


> Alan Cox <alan@lxorguk.ukuu.org.uk> writes: 
> > The preferable one for performance is certainly to backport the
> > 2.4 changes 

This patch against stock 2.2.19 is a backport of the task structure
ptrace flag of Linux 2.4.

It is available at
http://www.cs.wisc.edu/~zandy/ptrace

As we reported a couple weeks ago, under Linux 2.2 ptrace can globally
corrupt the FPU on SMPs.  Linus identified the problem as a race
between ptrace and the FPU trap handler over the process flags.  The
ptrace flag introduced in 2.4 eliminates the race.

This port is faithful to the 2.4 design.  Essentially it:

 - Adds a new variable `ptrace' to the task structure;
 - Adds new constants for this variable (PT_PTRACED etc.) and removes
   the corresponding old ones (PF_PTRACED etc.);
 - Replaces every ptrace-context reference to `flags' with a reference
   to `ptrace', and updates the constants used accordingly;
 - Updates ptrace offset constants, loads, and comparisons in assembly
   files.

The patch is complete for all platforms except ARM.  On ARM, I didn't
understand the meaning of the offset constants used in the assembly,
so I didn't try to fix them.  The patch does include the necessary
changes to C files on ARM.

We have applied (cleanly), compiled (cleanly) and tested the patch on
an x86 SMP, one of the same ones on which we saw FPU corruption.  We
have verified that FPU corruption cannot be produced, and that gdb and
strace still function.  We have not tested any other platform.

Please direct any questions or problems with the patch to
Victor Zandy <zandy@cs.wisc.edu>.

                 reply	other threads:[~2001-05-11 18:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=cpxeltvoi6t.fsf@goat.cs.wisc.edu \
    --to=zandy@cs.wisc.edu \
    --cc=linux-kernel@vger.kernel.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®