From owner-svn-src-head@freebsd.org Mon Apr 6 22:29:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A57927E0FE; Mon, 6 Apr 2020 22:29:15 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48x4vv3YYGz3CVZ; Mon, 6 Apr 2020 22:29:15 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 757C92F3F0; Mon, 6 Apr 2020 22:29:15 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 036MTF2x078722; Mon, 6 Apr 2020 22:29:15 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 036MTF7M078721; Mon, 6 Apr 2020 22:29:15 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202004062229.036MTF7M078721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Mon, 6 Apr 2020 22:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359671 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 359671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 22:29:15 -0000 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;