1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

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.
This commit is contained in:
Alan Cox 2008-05-11 20:33:47 +00:00
parent 1ff2ab846d
commit ef4d480ced
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178947
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -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)