[Top] [All Lists]

Re: VCE exceptions

To: "William J. Earl" <>
Subject: Re: VCE exceptions
Date: Fri, 3 Apr 1998 13:52:45 +0200
In-reply-to: <>; from William J. Earl on Thu, Apr 02, 1998 at 03:15:03PM -0800
References: <> <> <> <>
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.


Attachment: mmap.c
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>