svn commit: r349960 - head/sys/powerpc/aim

Justin Hibbits jhibbits at FreeBSD.org
Sat Jul 13 00:19:59 UTC 2019


Author: jhibbits
Date: Sat Jul 13 00:19:57 2019
New Revision: 349960
URL: https://svnweb.freebsd.org/changeset/base/349960

Log:
  Set pcpu curpmap for powerpc64
  
  Summary:
  If an illegal instruction is encountered on a process running on a
  powerpc64 kernel it would attempt to sync the cache before retrying the
  instruction "just in case".  However, since curpmap is not set, when
  moea64_sync_icache() attempts to lock the pmap, it's locking on a NULL pointer,
  triggering a panic.  Fix this by adding a (assumed unnecessary) fallback to
  curthread's pmap in moea64_sync_icache().
  
  Reported by:	alfredo.junior_eldorado.org.br
  Reviewed by:	luporl, alfredo.junior_eldorado.org.br
  Differential Revision: https://reviews.freebsd.org/D20911

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Sat Jul 13 00:12:35 2019	(r349959)
+++ head/sys/powerpc/aim/mmu_oea64.c	Sat Jul 13 00:19:57 2019	(r349960)
@@ -2838,6 +2838,9 @@ moea64_sync_icache(mmu_t mmu, pmap_t pm, vm_offset_t v
 	vm_paddr_t pa;
 	vm_size_t len;
 
+	if (__predict_false(pm == NULL))
+		pm = &curthread->td_proc->p_vmspace->vm_pmap;
+
 	PMAP_LOCK(pm);
 	while (sz > 0) {
 		lim = round_page(va+1);


More information about the svn-src-all mailing list