summaryrefslogtreecommitdiffstats
path: root/sys/i386
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/i386
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/i386')
-rw-r--r--sys/i386/i386/pmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 474fea5..a688810 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -4608,11 +4608,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