pmap_enter() masked off the page offset bits, pmap_kenter() did not.

This (I believe) is the cause of the XFree86 startup and/or mptable(8)
panics when programs were reading from /dev/mem at non-page-aligned
offsets.  The offsets were being converted into random page flags in the
page tables. :-(   (including PG_PS = 4MB page size)
This commit is contained in:
Peter Wemm 2000-05-24 14:22:22 +00:00
parent 632cd66778
commit 9f85bc03de
2 changed files with 2 additions and 0 deletions

View File

@ -176,6 +176,7 @@ mmrw(dev, uio, flags)
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
v &= ~PAGE_MASK;
pmap_kenter((vm_offset_t)ptvmmap, v);
o = (int)uio->uio_offset & PAGE_MASK;
c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK));

View File

@ -176,6 +176,7 @@ mmrw(dev, uio, flags)
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
v &= ~PAGE_MASK;
pmap_kenter((vm_offset_t)ptvmmap, v);
o = (int)uio->uio_offset & PAGE_MASK;
c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK));