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:
parent
632cd66778
commit
9f85bc03de
@ -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));
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user