summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mem.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-05-24 14:22:22 +0000
committerpeter <peter@FreeBSD.org>2000-05-24 14:22:22 +0000
commit6696467650d49ec51252f922278b9df904c4e8bf (patch)
tree39d91ae29580a92246a32e3d1a218f437bd2d37d /sys/amd64/amd64/mem.c
parent8fb37028044769c5af436308562a6a09417640de (diff)
downloadFreeBSD-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/amd64/amd64/mem.c')
-rw-r--r--sys/amd64/amd64/mem.c1
1 files changed, 1 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));
OpenPOWER on IntegriCloud