From owner-svn-src-releng@freebsd.org Tue Oct 15 16:27:04 2019 Return-Path: Delivered-To: svn-src-releng@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 D5E0414D231; Tue, 15 Oct 2019 16:27:04 +0000 (UTC) (envelope-from markj@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 46t16J5DdPz4TN0; Tue, 15 Oct 2019 16:27:04 +0000 (UTC) (envelope-from markj@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 96D1F2148B; Tue, 15 Oct 2019 16:27:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9FGR4Q4079425; Tue, 15 Oct 2019 16:27:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9FGR4Fm079424; Tue, 15 Oct 2019 16:27:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201910151627.x9FGR4Fm079424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 15 Oct 2019 16:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r353571 - releng/12.1/sys/riscv/riscv X-SVN-Group: releng X-SVN-Commit-Author: markj X-SVN-Commit-Paths: releng/12.1/sys/riscv/riscv X-SVN-Commit-Revision: 353571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2019 16:27:04 -0000 Author: markj Date: Tue Oct 15 16:27:04 2019 New Revision: 353571 URL: https://svnweb.freebsd.org/changeset/base/353571 Log: MFS r353475, r353553: Fix a couple of bugs around handling of PGA_WRITEABLE. Approved by: re (kib) Modified: releng/12.1/sys/riscv/riscv/pmap.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/riscv/riscv/pmap.c ============================================================================== --- releng/12.1/sys/riscv/riscv/pmap.c Tue Oct 15 16:05:55 2019 (r353570) +++ releng/12.1/sys/riscv/riscv/pmap.c Tue Oct 15 16:27:04 2019 (r353571) @@ -2090,6 +2090,7 @@ static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { + struct md_page *pvh; pt_entry_t old_l3; vm_paddr_t phys; vm_page_t m; @@ -2109,6 +2110,12 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ vm_page_aflag_set(m, PGA_REFERENCED); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m); pmap_pvh_free(&m->md, pmap, va); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) + vm_page_aflag_clear(m, PGA_WRITEABLE); + } } return (pmap_unuse_pt(pmap, va, l2e, free)); @@ -2830,7 +2837,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v if ((new_l3 & PTE_SW_MANAGED) == 0) free_pv_entry(pmap, pv); if ((om->aflags & PGA_WRITEABLE) != 0 && - TAILQ_EMPTY(&om->md.pv_list)) + TAILQ_EMPTY(&om->md.pv_list) && + ((om->flags & PG_FICTITIOUS) != 0 || + TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) vm_page_aflag_clear(om, PGA_WRITEABLE); } pmap_invalidate_page(pmap, va);