Date: Wed, 17 Jun 2020 19:45:05 +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: r362284 - head/sys/arm64/arm64 Message-ID: <202006171945.05HJj5Ia025704@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Wed Jun 17 19:45:05 2020 New Revision: 362284 URL: https://svnweb.freebsd.org/changeset/base/362284 Log: Support pmap_extract_and_hold on arm64 stage 2 mappings Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D24469 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 17 18:47:59 2020 (r362283) +++ head/sys/arm64/arm64/pmap.c Wed Jun 17 19:45:05 2020 (r362284) @@ -1228,9 +1228,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ vm_offset_t off; vm_page_t m; int lvl; + bool use; - PMAP_ASSERT_STAGE1(pmap); - m = NULL; PMAP_LOCK(pmap); pte = pmap_pte(pmap, va, &lvl); @@ -1244,8 +1243,19 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ (lvl < 3 && (tpte & ATTR_DESCR_MASK) == L1_BLOCK), ("pmap_extract_and_hold: Invalid pte at L%d: %lx", lvl, tpte & ATTR_DESCR_MASK)); - if (((tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW)) || - ((prot & VM_PROT_WRITE) == 0)) { + + use = false; + if ((prot & VM_PROT_WRITE) == 0) + use = true; + else if (pmap->pm_stage == PM_STAGE1 && + (tpte & ATTR_S1_AP_RW_BIT) == ATTR_S1_AP(ATTR_S1_AP_RW)) + use = true; + else if (pmap->pm_stage == PM_STAGE2 && + ((tpte & ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE)) == + ATTR_S2_S2AP(ATTR_S2_S2AP_WRITE))) + use = true; + + if (use) { switch(lvl) { case 1: off = va & L1_OFFSET;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006171945.05HJj5Ia025704>