Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@convergence.de>
To: "Kevin D. Kissell" <kevink@mips.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Once again: test_and_set for CPUs w/o LL/SC
Date: Mon, 7 Oct 2002 20:43:44 +0200	[thread overview]
Message-ID: <20021007184344.GA17548@convergence.de> (raw)
In-Reply-To: <01fd01c26e1d$add77240$10eca8c0@grendel>

On Mon, Oct 07, 2002 at 06:21:52PM +0200, Kevin D. Kissell wrote:
>
> When I first proposed the branch-likely hack last winter,
> I thought it might be worth while to do a through code
> inspection to determine what set of values could never
> be returned in k1 (or k0 for all I care) if an exception
> was taken, such that there would be no mods to the
> kernel required whatsoever.  I spent a little time going 
> down that path, and it does look at first glance as if one 
> could guarantee that one will never come out of an exception 
> with k1 equal to 0xffdadaff in current oss/linux-mips cvs
> sources, but the guys at Sony, who have a big interest in 
> this technique, given that the PS2 has no LL/SC,
> prefered a more conservative approach which explicitly
> clobbered the selective register on all exceptions,
> even if it meant some small performance impact.
> That's probably going to be a more reliable design,
> though I would still consider leaving the TLB refill handler
> untouched and counting on the fact that k1 must contain
> a non-lethal EntryLo value on return from the exception.

In my original posting from Mon, Sep 16, 2002 (maybe I should
have reposted it in full?), a had appended a patch which
leaves the TLB handlers alone (k1 always ends up with an EntryLo value,
thus bit 31 is guaranteed to be 0), but explicitly sets k1 to zero in
RESTORE_SP_AND_RET.

> As for glibc, the possibilities are numerous and I'm not
> the guy who'd have to make it work.

The question is how the glibc can detect if
a) the CPU does not have LL/SC
b) the kernel guarantees k1 != MAGIC

I think the kernel should announce this explicitly.
In my patch from Sep 16 I used a sysctl, but that's
probably bad because glibc would rely on a real new
include/linux/sysctl.h.

I need some advice on this (maybe add a line to /proc/cpuinfo,
or create a new /proc entry? or add a sysmips call to get
this info?).

I also want to know if there's public interest to get such
a change in the kernel. If yes, I will try to get a matching
patch into glibc. If no, I will just post the current patch I
use to the list for the hackers to pick up.


Regards,
Johannes

  parent reply	other threads:[~2002-10-07 18:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-16 16:40 Once again: test_and_set for CPUs w/o LL/SC Johannes Stezenbach
2002-10-07 14:47 ` Johannes Stezenbach
2002-10-07 16:21   ` Kevin D. Kissell
2002-10-07 16:21     ` Kevin D. Kissell
2002-10-07 18:43     ` Johannes Stezenbach [this message]
2002-10-07 18:51       ` Daniel Jacobowitz
2002-10-15 17:52         ` Johannes Stezenbach
2002-10-08  7:38       ` Kevin D. Kissell
2002-10-08  7:38         ` Kevin D. Kissell
2002-10-15 15:36       ` Maciej W. Rozycki
2002-10-15 17:21         ` Johannes Stezenbach
2002-10-16 12:20           ` Maciej W. Rozycki
2002-10-16 12:52             ` Johannes Stezenbach
2002-10-16 16:30               ` Johannes Stezenbach
2002-10-17  9:47                 ` Gleb O. Raiko
2002-10-17 12:02                   ` Maciej W. Rozycki
2002-10-17 13:11                     ` Johannes Stezenbach
2002-10-17 13:32                       ` Gleb O. Raiko
2002-10-17 14:13                         ` Johannes Stezenbach
2002-10-16 18:11         ` Johannes Stezenbach
2002-10-16 18:23           ` Johannes Stezenbach
2002-10-17 11:57           ` Maciej W. Rozycki
2002-10-17 13:25             ` Johannes Stezenbach
2002-10-15 15:17     ` Maciej W. Rozycki
2002-10-15 16:50       ` Johannes Stezenbach

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=20021007184344.GA17548@convergence.de \
    --to=js@convergence.de \
    --cc=kevink@mips.com \
    --cc=linux-mips@linux-mips.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