git: 2a88ca31330c - stable/13 - Create pmap_mask_set_locked on arm64
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Sep 2023 11:00:49 UTC
The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2a88ca31330c24cdb364218c5e0404b8878fa9f5 commit 2a88ca31330c24cdb364218c5e0404b8878fa9f5 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2023-04-12 12:09:06 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2023-09-25 08:41:16 +0000 Create pmap_mask_set_locked on arm64 Create a locked version of pmap_mask_set. We will need this for BTI support. Sponsored by: Arm Ltd (cherry picked from commit 421516f25e9cfa91b33841f633a463889bc10af7) --- sys/arm64/arm64/pmap.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index cee9ddffddda..edd34bcd5e68 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -3449,14 +3449,14 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t mask, * pmap and range */ static void -pmap_mask_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t mask, +pmap_mask_set_locked(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t mask, pt_entry_t nbits, bool invalidate) { vm_offset_t va, va_next; pd_entry_t *l0, *l1, *l2; pt_entry_t *l3p, l3; - PMAP_LOCK(pmap); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); for (; sva < eva; sva = va_next) { l0 = pmap_l0(pmap, sva); if (pmap_load(l0) == 0) { @@ -3549,6 +3549,14 @@ pmap_mask_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t mask, if (va != va_next && invalidate) pmap_invalidate_range(pmap, va, sva, true); } +} + +static void +pmap_mask_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t mask, + pt_entry_t nbits, bool invalidate) +{ + PMAP_LOCK(pmap); + pmap_mask_set_locked(pmap, sva, eva, mask, nbits, invalidate); PMAP_UNLOCK(pmap); }