Subject: Re: UVM bug
To: Neil A. Carson <neil@causality.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 05/26/1999 15:11:24
On Wed, 26 May 1999 15:14:20 -0700 
 "Neil A. Carson" <neil@causality.com> wrote:

 > I added an && (pos + size) onto the end of the test to fix this one I
 > think.
 > 
 > If this is correct, can someone commit it please?

Actually, for various reasons, the VM system cannot handle the last page
of physical memory, due to the way to denotes the "end" just about everywhere.

I.e. a 4K region is 0x0000 -> 0x1000, NOT 0x0000 -> 0x0fff.

 > "Neil A. Carson" wrote:
 > > 
 > > So,
 > > 
 > > In order to reprogram a flash, I need to mmap the last page of physical
 > > memory using /dev/mem:-)
 > > 
 > > If you look at the check in sys_mmap() in uvm_mmap.c, you'll note that
 > > the test (if (pos+size == 0) || (!pos)) causes this to fail in the case
 > > of the last page physical RAM (my example is at 0xFFF80000 size 0x80000
 > > on i386).
 > > 
 > > Can someone suggest the best way to clean this up? It'd be a lot easier
 > > in assembler by just checking for a carry :-)
 > > 
 > >         Neil

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>