Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2018 15:06:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341468 - stable/12/sys/amd64/amd64
Message-ID:  <201812041506.wB4F6O8S073653@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Dec  4 15:06:24 2018
New Revision: 341468
URL: https://svnweb.freebsd.org/changeset/base/341468

Log:
  MFC r341096:
  Fix assert condition in pmap_large_unmap().

Modified:
  stable/12/sys/amd64/amd64/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/12/sys/amd64/amd64/pmap.c	Tue Dec  4 15:04:48 2018	(r341467)
+++ stable/12/sys/amd64/amd64/pmap.c	Tue Dec  4 15:06:24 2018	(r341468)
@@ -8441,9 +8441,10 @@ pmap_large_unmap(void *svaa, vm_size_t len)
 			KASSERT((va & PDPMASK) == 0,
 			    ("PDPMASK bit set, va %#lx pdpe %#lx pdp %#lx", va,
 			    (u_long)pdpe, pdp));
-			KASSERT(len <= NBPDP,
-			    ("len < NBPDP, sva %#lx va %#lx pdpe %#lx pdp %#lx "
-			    "len %#lx", sva, va, (u_long)pdpe, pdp, len));
+			KASSERT(va + NBPDP <= sva + len,
+			    ("unmap covers partial 1GB page, sva %#lx va %#lx "
+			    "pdpe %#lx pdp %#lx len %#lx", sva, va,
+			    (u_long)pdpe, pdp, len));
 			*pdpe = 0;
 			inc = NBPDP;
 			continue;
@@ -8457,9 +8458,10 @@ pmap_large_unmap(void *svaa, vm_size_t len)
 			KASSERT((va & PDRMASK) == 0,
 			    ("PDRMASK bit set, va %#lx pde %#lx pd %#lx", va,
 			    (u_long)pde, pd));
-			KASSERT(len <= NBPDR,
-			    ("len < NBPDR, sva %#lx va %#lx pde %#lx pd %#lx "
-			    "len %#lx", sva, va, (u_long)pde, pd, len));
+			KASSERT(va + NBPDR <= sva + len,
+			    ("unmap covers partial 2MB page, sva %#lx va %#lx "
+			    "pde %#lx pd %#lx len %#lx", sva, va, (u_long)pde,
+			    pd, len));
 			pde_store(pde, 0);
 			inc = NBPDR;
 			m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812041506.wB4F6O8S073653>