Subject: Re: port-mips/15965: NEW_PIPE broken on port-mips
To: Takao Shinohara <shin@sm.sony.co.jp>
From: Chuck Silvers <chuq@chuq.com>
List: netbsd-bugs
Date: 03/24/2002 08:50:47
ah, that's what you're seeing.  yes, we will create virtual aliases
in the pipe code now that the hardware will detect, but those aren't
a problem because all the mappings are read-only.  so if there's no
L2 cache to notice the aliases then we'll actually have aliased cache
lines, but those will always have the same data.

before I made that change to pmap_protect(), I tested it using the tar test
on a cobalt raq2 (which has no L2 cache) and there was no corruption.

-Chuck


On Sun, Mar 24, 2002 at 04:58:05PM +0900, Takao Shinohara wrote:
> Chuck Silvers <chuq@chuq.com> writes:
> > the "bad" aliases we're generating now should not cause any problems,
> > because all mappings of loaned pages are read-only and thus safe to cache
> > if all the changes made to the page before the page is loaned are flushed
> > to main memory when the loan is created.  that's why the cache flush in
> > pmap_protect() fixes the problem.  are you sure NEW_PIPE still has
> > problems on mips?
> 
> I couldn't figure out the scenario, but I can confirm that there is
> virtual alias wich was detected by hardware(R4400 with S-cache).
> 
> My experiment was;
> 
> 1) tweak pmap.c to enforce virtual alias elimination is enabled for
>    R4400 with SC.
>    (it is disabled by default for CPUs with SC.)
> 
> 2) compile kernel with -DDEBUG.
> 
> 3) make sure NEW_PIPE is used.
>    % cat opt_pipe.h
> /* option `PIPE_NODIRECT' not defined */
> /* option `PIPE_SOCKETPAIR' not defined */
> 
> 4) boot kernel.
> 
> 5) make sure VCED_count's are all 0 with ddb.
>    this means there was no virtual alias (no VCED was detected by hardware).
> 
> 6) perform simple tar test.
>    % cd /; tar cf - bin | (cd /tmp; tar xfpv -)
> 
> 7) examine VCED_count's and see there was virtual alias.
> 
> db> x/x VCED_count,12
> VCED_count:     0           0           0           0           0           0
> VCED_count+0x18:        0           0           c6bc        0           0
> VCED_count+0x2c:        0           0           0           0           0
> VCED_epc:       8012d83c    ca55e7c0
> 
> --- Takao Shinohara