Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jul 2019 00:19:58 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349960 - head/sys/powerpc/aim
Message-ID:  <201907130019.x6D0JwlU015753@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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