svn commit: r359671 - head/sys/riscv/riscv

Jessica Clarke jrtc27 at FreeBSD.org
Mon Apr 6 22:29:15 UTC 2020


Author: jrtc27
Date: Mon Apr  6 22:29:15 2020
New Revision: 359671
URL: https://svnweb.freebsd.org/changeset/base/359671

Log:
  riscv: Fix pmap_fault_fixup for L3 pages
  
  Summary:
  The parentheses being in the wrong place means that, for L3 pages,
  oldpte has all bits except PTE_V cleared, and so all the subsequent
  checks against oldpte will fail, causing us to bail out and not retry
  the faulting instruction after an SFENCE.VMA. This causes a WITNESS +
  INVARIANTS kernel to fault on the "Chisel P3" (BOOM-based) DARPA SSITH
  GFE SoC in pmap_init when writing to pv_table and, being a nofault
  entry, subsequently panic with:
  
    panic: vm_fault_lookup: fault on nofault entry, addr: 0xffffffc004e00000
  
  Reviewed by:	markj
  Approved by:	markj
  Differential Revision:	https://reviews.freebsd.org/D24315

Modified:
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/riscv/pmap.c
==============================================================================
--- head/sys/riscv/riscv/pmap.c	Mon Apr  6 22:14:50 2020	(r359670)
+++ head/sys/riscv/riscv/pmap.c	Mon Apr  6 22:29:15 2020	(r359671)
@@ -2416,7 +2416,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_
 		goto done;
 	if ((l2e & PTE_RWX) == 0) {
 		pte = pmap_l2_to_l3(l2, va);
-		if (pte == NULL || ((oldpte = pmap_load(pte) & PTE_V)) == 0)
+		if (pte == NULL || ((oldpte = pmap_load(pte)) & PTE_V) == 0)
 			goto done;
 	} else {
 		pte = l2;


More information about the svn-src-head mailing list