Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2020 14:17:35 +0000 (UTC)
From:      Mark Johnston <markj@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: r363389 - in stable/12/sys: amd64/amd64 i386/i386 mips/mips powerpc/aim powerpc/booke
Message-ID:  <202007211417.06LEHZtv005464@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jul 21 14:17:35 2020
New Revision: 363389
URL: https://svnweb.freebsd.org/changeset/base/363389

Log:
  MFC r363266 (by cem):
  Revert r240317 to prevent leaking pmap entries

Modified:
  stable/12/sys/amd64/amd64/pmap.c
  stable/12/sys/i386/i386/pmap.c
  stable/12/sys/mips/mips/pmap.c
  stable/12/sys/powerpc/aim/mmu_oea.c
  stable/12/sys/powerpc/aim/mmu_oea64.c
  stable/12/sys/powerpc/booke/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/pmap.c
==============================================================================
--- stable/12/sys/amd64/amd64/pmap.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/amd64/amd64/pmap.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -7991,8 +7991,10 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size)
 			return;
 		}
 	}
-	if (pmap_initialized)
+	if (pmap_initialized) {
+		pmap_qremove(va, atop(size));
 		kva_free(va, size);
+	}
 }
 
 /*

Modified: stable/12/sys/i386/i386/pmap.c
==============================================================================
--- stable/12/sys/i386/i386/pmap.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/i386/i386/pmap.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -5600,8 +5600,10 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size)
 			return;
 		}
 	}
-	if (pmap_initialized)
+	if (pmap_initialized) {
+		pmap_qremove(va, atop(size));
 		kva_free(va, size);
+	}
 }
 
 /*

Modified: stable/12/sys/mips/mips/pmap.c
==============================================================================
--- stable/12/sys/mips/mips/pmap.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/mips/mips/pmap.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -3276,6 +3276,7 @@ pmap_unmapdev(vm_offset_t va, vm_size_t size)
 	base = trunc_page(va);
 	offset = va & PAGE_MASK;
 	size = roundup(size + offset, PAGE_SIZE);
+	pmap_qremove(base, atop(size));
 	kva_free(base, size);
 #endif
 }

Modified: stable/12/sys/powerpc/aim/mmu_oea.c
==============================================================================
--- stable/12/sys/powerpc/aim/mmu_oea.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/powerpc/aim/mmu_oea.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -2682,6 +2682,7 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t siz
 		base = trunc_page(va);
 		offset = va & PAGE_MASK;
 		size = roundup(offset + size, PAGE_SIZE);
+		moea_qremove(base, atop(size));
 		kva_free(base, size);
 	}
 }

Modified: stable/12/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- stable/12/sys/powerpc/aim/mmu_oea64.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/powerpc/aim/mmu_oea64.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -2794,6 +2794,7 @@ moea64_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_t s
 	offset = va & PAGE_MASK;
 	size = roundup2(offset + size, PAGE_SIZE);
 
+	moea64_qremove(base, atop(size));
 	kva_free(base, size);
 }
 

Modified: stable/12/sys/powerpc/booke/pmap.c
==============================================================================
--- stable/12/sys/powerpc/booke/pmap.c	Tue Jul 21 13:50:10 2020	(r363388)
+++ stable/12/sys/powerpc/booke/pmap.c	Tue Jul 21 14:17:35 2020	(r363389)
@@ -3686,6 +3686,7 @@ mmu_booke_unmapdev(mmu_t mmu, vm_offset_t va, vm_size_
 		base = trunc_page(va);
 		offset = va & PAGE_MASK;
 		size = roundup(offset + size, PAGE_SIZE);
+		mmu_booke_qremove(base, atop(size));
 		kva_free(base, size);
 	}
 #endif



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