svn commit: r338932 - head/sys/amd64/amd64

Konstantin Belousov kib at FreeBSD.org
Tue Sep 25 20:07:59 UTC 2018


Author: kib
Date: Tue Sep 25 20:07:58 2018
New Revision: 338932
URL: https://svnweb.freebsd.org/changeset/base/338932

Log:
  Fix some uses of dmaplimit.
  
  dmaplimit is the first byte after the end of DMAP.
  
  Reported by:	"Johnson, Archna" <Archna.Johnson at netapp.com>
  Reviewed by:	alc, markj
  Approved by:	re (gjb)
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D17318

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Tue Sep 25 19:53:19 2018	(r338931)
+++ head/sys/amd64/amd64/pmap.c	Tue Sep 25 20:07:58 2018	(r338932)
@@ -1422,7 +1422,7 @@ pmap_init(void)
 		if (ppim->va == 0)
 			continue;
 		/* Make the direct map consistent */
-		if (ppim->pa < dmaplimit && ppim->pa + ppim->sz < dmaplimit) {
+		if (ppim->pa < dmaplimit && ppim->pa + ppim->sz <= dmaplimit) {
 			(void)pmap_change_attr(PHYS_TO_DMAP(ppim->pa),
 			    ppim->sz, ppim->mode);
 		}
@@ -7055,7 +7055,7 @@ pmap_mapdev_attr(vm_paddr_t pa, vm_size_t size, int mo
 		 * If the specified range of physical addresses fits within
 		 * the direct map window, use the direct map.
 		 */
-		if (pa < dmaplimit && pa + size < dmaplimit) {
+		if (pa < dmaplimit && pa + size <= dmaplimit) {
 			va = PHYS_TO_DMAP(pa);
 			if (!pmap_change_attr(va, size, mode))
 				return ((void *)(va + offset));


More information about the svn-src-head mailing list