Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 May 2018 16:14:53 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333985 - head/sys/arm64/arm64
Message-ID:  <201805211614.w4LGErKQ059677@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon May 21 16:14:53 2018
New Revision: 333985
URL: https://svnweb.freebsd.org/changeset/base/333985

Log:
  Restrict the faulting addresses we call pmap_fault from to just those that
  may fault due to superpage mappings being changed.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==============================================================================
--- head/sys/arm64/arm64/trap.c	Mon May 21 16:13:43 2018	(r333984)
+++ head/sys/arm64/arm64/trap.c	Mon May 21 16:14:53 2018	(r333985)
@@ -189,8 +189,16 @@ data_abort(struct thread *td, struct trapframe *frame,
 		}
 	}
 
-	if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
-		return;
+	/*
+	 * We may fault from userspace or when in a DMAP region due to
+	 * a superpage being unmapped when the access took place. In these
+	 * cases we need to wait for the pmap to be unlocked and check
+	 * if the translation is still invalid.
+	 */
+	if (map != kernel_map || VIRT_IN_DMAP(far)) {
+		if (pmap_fault(map->pmap, esr, far) == KERN_SUCCESS)
+			return;
+	}
 
 	KASSERT(td->td_md.md_spinlock_count == 0,
 	    ("data abort with spinlock held"));



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