summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-05-11 20:33:47 +0000
committeralc <alc@FreeBSD.org>2008-05-11 20:33:47 +0000
commit9fed63a445096a42d6dc9346c16c798c73682917 (patch)
treed6293ecdd385d3aeb6c72af7cb8b07fd19d3234b /sys/amd64
parent10234848d588839bb6f9394d46a919e69976127d (diff)
downloadFreeBSD-src-9fed63a445096a42d6dc9346c16c798c73682917.zip
FreeBSD-src-9fed63a445096a42d6dc9346c16c798c73682917.tar.gz
Correct an error in pmap_align_superpage(). Specifically, correctly
handle the case where the mapping is greater than a superpage in size but the alignment of the physical pages spans a superpage boundary.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index dcd6b2a9..5af214f 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -4480,11 +4480,12 @@ pmap_align_superpage(vm_object_t object, vm_ooffset_t offset,
{
vm_offset_t superpage_offset;
+ if (size < NBPDR)
+ return;
if (object != NULL && (object->flags & OBJ_COLORED) != 0)
offset += ptoa(object->pg_color);
superpage_offset = offset & PDRMASK;
- if (size < superpage_offset ||
- size - superpage_offset < NBPDR ||
+ if (size - ((NBPDR - superpage_offset) & PDRMASK) < NBPDR ||
(*addr & PDRMASK) == superpage_offset)
return;
if ((*addr & PDRMASK) < superpage_offset)
OpenPOWER on IntegriCloud