The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a5371aed0235915187a3d39809a637a63d510b37
commit a5371aed0235915187a3d39809a637a63d510b37 Author: Andrew Turner <[email protected]> AuthorDate: 2025-09-04 17:24:07 +0000 Commit: Andrew Turner <[email protected]> CommitDate: 2026-01-14 21:14:14 +0000 arm64: Create a TLBI invalidate for the kernel Add pmap_s1_invalidate_all_kernel to remove the need to check for the kernel_pmap when it's passed in. While here replace pmap calls to cpu_tlb_flushID with pmap_s1_invalidate_all_kernel as they are identical. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D52183 (cherry picked from commit 8df4dc90952be7afee36e3cc80c1a76e2c66fbac) --- sys/arm64/arm64/pmap.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a3014fd5cee3..b25c862b8ea3 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -194,6 +194,8 @@ __exclusive_cache_line static struct pmap_large_md_page pv_dummy_large; #define pv_dummy pv_dummy_large.pv_page __read_mostly static struct pmap_large_md_page *pv_table; +static __inline void pmap_s1_invalidate_all_kernel(void); + static struct pmap_large_md_page * _pa_to_pmdp(vm_paddr_t pa) { @@ -1186,7 +1188,7 @@ pmap_bootstrap_dmap(vm_paddr_t min_pa) } } - cpu_tlb_flushID(); + pmap_s1_invalidate_all_kernel(); } static void @@ -1327,7 +1329,7 @@ pmap_bootstrap(vm_size_t kernlen) /* And the l3 tables for the early devmap */ pmap_bootstrap_l3(VM_MAX_KERNEL_ADDRESS - (PMAP_MAPDEV_EARLY_SIZE)); - cpu_tlb_flushID(); + pmap_s1_invalidate_all_kernel(); #define alloc_pages(var, np) \ (var) = bs_state.freemempos; \ @@ -1728,6 +1730,15 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pmap_s2_invalidate_range(pmap, sva, eva, final_only); } +static __inline void +pmap_s1_invalidate_all_kernel(void) +{ + dsb(ishst); + __asm __volatile("tlbi vmalle1is"); + dsb(ish); + isb(); +} + /* * Invalidates all cached intermediate- and final-level TLB entries for the * given virtual address space. @@ -6615,7 +6626,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) pa += L2_SIZE; } if ((old_l2e & ATTR_DESCR_VALID) != 0) - pmap_s1_invalidate_all(kernel_pmap); + pmap_s1_invalidate_all_kernel(); else { /* * Because the old entries were invalid and the new @@ -6691,7 +6702,7 @@ pmap_unmapbios(void *p, vm_size_t size) } } if (preinit_map) { - pmap_s1_invalidate_all(kernel_pmap); + pmap_s1_invalidate_all_kernel(); return; }
