diff options
author | peter <peter@FreeBSD.org> | 2000-05-24 14:22:22 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-05-24 14:22:22 +0000 |
commit | 6696467650d49ec51252f922278b9df904c4e8bf (patch) | |
tree | 39d91ae29580a92246a32e3d1a218f437bd2d37d /sys | |
parent | 8fb37028044769c5af436308562a6a09417640de (diff) | |
download | FreeBSD-src-6696467650d49ec51252f922278b9df904c4e8bf.zip FreeBSD-src-6696467650d49ec51252f922278b9df904c4e8bf.tar.gz |
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)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/mem.c | 1 | ||||
-rw-r--r-- | sys/i386/i386/mem.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c index d6abfd3..9a4c715 100644 --- a/sys/amd64/amd64/mem.c +++ b/sys/amd64/amd64/mem.c @@ -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)); diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c index d6abfd3..9a4c715 100644 --- a/sys/i386/i386/mem.c +++ b/sys/i386/i386/mem.c @@ -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)); |