From owner-svn-src-all@freebsd.org Wed May 13 17:20:51 2020 Return-Path: Delivered-To: svn-src-all@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 F022A2FB400; Wed, 13 May 2020 17:20:51 +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 49MhJz67j3z4J4F; Wed, 13 May 2020 17:20:51 +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 CDF2424C80; Wed, 13 May 2020 17:20:51 +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 04DHKpSb067876; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DHKpZ0067875; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005131720.04DHKpZ0067875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 13 May 2020 17:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361010 - 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: 361010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 17:20:52 -0000 Author: jrtc27 Date: Wed May 13 17:20:51 2020 New Revision: 361010 URL: https://svnweb.freebsd.org/changeset/base/361010 Log: riscv: Fix pmap_protect for superpages When protecting a superpage, we would previously fall through to the non-superpage case and read the contents of the superpage as PTEs, potentially modifying them and trying to look up underlying VM pages that don't exist if they happen to look like PTEs we would care about. This led to nginx causing an unexpected page fault in pmap_protect that panic'ed the kernel. Instead, if we see a superpage, we are done for this range and should continue to the next. Reviewed by: markj, jhb (mentor) Approved by: markj, jhb (mentor) Differential Revision: https://reviews.freebsd.org/D24827 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed May 13 16:36:42 2020 (r361009) +++ head/sys/riscv/riscv/pmap.c Wed May 13 17:20:51 2020 (r361010) @@ -2329,6 +2329,7 @@ retryl2: if (!atomic_fcmpset_long(l2, &l2e, l2e & ~mask)) goto retryl2; anychanged = true; + continue; } else { if (!pv_lists_locked) { pv_lists_locked = true;