Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread Simon Burge
Antti Kantee wrote:

 On Tue Nov 09 2010 at 13:10:02 +1100, Simon Burge wrote:
  David Holland wrote:
  
   On Mon, Nov 08, 2010 at 06:09:39PM +, Antti Kantee wrote:
 Modified Files:
src/sys/arch/mips/mips: locore_mips1.S
 
 Log Message:
 In TLBRead, restore PID before doing the saves so that the caller's
 TLB entries are used instead of the PID given as the argument.
 
 from Alessandro Forin
   
   [ ... ]
   
   Do you have any further explanations or reports of symptoms? I don't
   see anything on any of the mips lists.
  
  I'm curious about this too.  That code hasn't changed for at least
  14 years...
 
 Given that it's only called from ddb, i'm not too surprised nobody has
 noticed.  Now, unless someone argues that the stores should definitely
 happen with the arbitrary PID set up by tlbr, let's flag the change as
 obvious, get on with something useful, and leave noppy philosophy to
 some other book club.

Thanks for the extra details.  It may be obvious with the background
info you've now provided, but wasn't from your initial commit message.

Cheers,
Simon.


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread Antti Kantee
On Tue Nov 09 2010 at 22:43:53 +1100, Simon Burge wrote:
   I'm curious about this too.  That code hasn't changed for at least
   14 years...
  
  Given that it's only called from ddb, i'm not too surprised nobody has
  noticed.  Now, unless someone argues that the stores should definitely
  happen with the arbitrary PID set up by tlbr, let's flag the change as
  obvious, get on with something useful, and leave noppy philosophy to
  some other book club.
 
 Thanks for the extra details.  It may be obvious with the background
 info you've now provided, but wasn't from your initial commit message.

Gotta love source-changes-full and nxr.netbsd.org ;)


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread Antti Kantee
On Tue Nov 09 2010 at 13:10:02 +1100, Simon Burge wrote:
 David Holland wrote:
 
  On Mon, Nov 08, 2010 at 06:09:39PM +, Antti Kantee wrote:
Modified Files:
 src/sys/arch/mips/mips: locore_mips1.S

Log Message:
In TLBRead, restore PID before doing the saves so that the caller's
TLB entries are used instead of the PID given as the argument.

from Alessandro Forin
  
  [ ... ]
  
  Do you have any further explanations or reports of symptoms? I don't
  see anything on any of the mips lists.
 
 I'm curious about this too.  That code hasn't changed for at least
 14 years...

Given that it's only called from ddb, i'm not too surprised nobody has
noticed.  Now, unless someone argues that the stores should definitely
happen with the arbitrary PID set up by tlbr, let's flag the change as
obvious, get on with something useful, and leave noppy philosophy to
some other book club.


Re: CVS commit: src/tests/fs/tmpfs

2010-11-09 Thread Antti Kantee
On Tue Nov 09 2010 at 13:01:34 +, Julio Merino wrote:
 Module Name:  src
 Committed By: jmmv
 Date: Tue Nov  9 13:01:34 UTC 2010
 
 Modified Files:
   src/tests/fs/tmpfs: t_create.sh
 
 Log Message:
 Remove ugly workaround to skip this if unprivileged-user=_atf and just use
 'su -m' as pooka@ did in t_mkdir.sh.  As he says this may still fail if
 root's shell is csh; we need a better solution.

I suggested a better solution a few weeks ago in email in our unpriv'd
discussion.  (just in case you missed it in those too long emails)


Re: CVS commit: src/tests/fs/tmpfs

2010-11-09 Thread Alan Barrett
On Tue, 09 Nov 2010, Julio Merino wrote:
 Log Message:
 Remove ugly workaround to skip this if unprivileged-user=_atf and just use
 'su -m' as pooka@ did in t_mkdir.sh.  As he says this may still fail if
 root's shell is csh; we need a better solution.

su -m ${user} -c /bin/sh -c 'your command here'
works if you get the quoting right, but I still think you
need a better solution.

--apb (Alan Barrett)


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread David Holland
On Tue, Nov 09, 2010 at 01:46:46PM +0200, Antti Kantee wrote:
   Thanks for the extra details.  It may be obvious with the background
   info you've now provided, but wasn't from your initial commit message.
  
  Gotta love source-changes-full and nxr.netbsd.org ;)

No, it's not obvious from those either, and I'm even familiar with the
architecture. This whole thing could have been avoided if you'd
written a clear commit message; can you revise the text in CVS to have
fewer dangling referents?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread Warner Losh

 On 11/09/2010 13:54, David Holland wrote:

On Tue, Nov 09, 2010 at 01:46:46PM +0200, Antti Kantee wrote:
  Thanks for the extra details.  It may be obvious with the background
  info you've now provided, but wasn't from your initial commit message.
  
Gotta love source-changes-full and nxr.netbsd.org ;)

No, it's not obvious from those either, and I'm even familiar with the
architecture. This whole thing could have been avoided if you'd
written a clear commit message; can you revise the text in CVS to have
fewer dangling referents?
Or better yet, improve the comments so people looking at the code know 
what the considerations are?  Seems like an area where a sentence or two 
would save a lot of grief in the future...


Warner


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread David Holland
On Mon, Nov 08, 2010 at 03:49:09PM -0700, Warner Losh wrote:
  I don't have a mips1-specific reference on hand, but my recollection
  is that you need *three* nops when messing with cop0 registers for all
  effects to flush through.
  locore_mips1.S doesn't agree with your recollection, e.g. mips1_TLBUpdate
  right above mips1_TLBRead.

What about it? It has some nops scattered in it, but they're neither
documented nor particularly systematic.

  mips1 had a 2 stage pipeline, so at most you'd need 1 nop.  3 nops
  is for the R4000's and similar.

I'm not sure about that. The only docs I still have do not describe
the 3-cycle wait for interrupt switching as r4000-specific, although
these docs do describe other pipeline hazards as r4000-specific. That
doesn't prove much for certain, but it's at least suggestive.

(I used to have the Hennessey  Patterson textbook that described the
original r2000 in gory detail, but I got rid of it because it was
outdated...)

Anyway, the exactly one nop that you do see in some mips1 contexts
(e.g. branch delays, and using values after fetching them) is the
offset between certain pipeline stages, not the total pipeline depth.

  Then it got weird with multi-issue, threads, and sometimes silicon
  bugs that required more before MIPS32r2 and MIPS64r2 codified a
  single, special kind of nop that did the trick.

You still need more than one of those in some cases, to the best of my
knowledge.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/arch/mips/mips

2010-11-09 Thread David Holland
On Tue, Nov 09, 2010 at 02:20:11PM -0700, Warner Losh wrote:
  No, it's not obvious from those either, and I'm even familiar with the
  architecture. This whole thing could have been avoided if you'd
  written a clear commit message; can you revise the text in CVS to have
  fewer dangling referents?
 
  Or better yet, improve the comments so people looking at the code
  know what the considerations are?  Seems like an area where a
  sentence or two would save a lot of grief in the future...

*slaps self*

done - anyone else who wants to put an oar in please edit accordingly.

-- 
David A. Holland
dholl...@netbsd.org