On Thu, Apr 02, 1998 at 03:15:03PM -0800, William J. Earl wrote:
> At MIPS, with the Magnum 4000PC under RISC/os, and at SGI, with the
> Indy R4000PC (and later R4600 and R5000), I modified RISC/os and IRIX to
> control virtual aliasing, but only for those platforms without hardware
> VCE detection (in order to minimize time to market).
VCE's don't look too difficult to tackle under Linux.
> Note that taking a K0SEG address for a physical page which is also mapped
> to user space can easily cause a VCE, since there is a good chance that
> the K0SEG virtual index differs from the user space virtual index, unless
> you match physical page color to virtual page color when allocating pages.
> Note that you have to do that for any pages which must be accessible in
> the general exception handler, since you cannot handle a VCE in the
> exception handler.
The VCE bug is actually worse than I thought before. I was in the assumption
that we'd handle all cases were VC might hit us because the MIPS ABI takes
care of by it's restrictions of the virtual addresses for mmaping. Well,
I was wrong. Writing via write(2) to a file that is also mmap(2)ed may
result in virtual coherency problems.
Another problem is that under Linux one cannot simply allocate a page of
a desired colour - which would of course be the prefered solution. Luckily
a vce exceptionhandler will not run into the problem under Linux.
A small test program for the mmap/write problem attached. If may be
necessary to start it several times in order to make it print the ``Big
trouble, man ...'' message.
Description: Text document