aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/booke/pmap_32.c
diff options
context:
space:
mode:
authorBrandon Bergren <bdragon@FreeBSD.org>2021-03-29 22:59:19 +0000
committerBrandon Bergren <bdragon@FreeBSD.org>2021-03-29 23:22:16 +0000
commit5a08df100b58911396e0cc1403f0504bc68461bd (patch)
treec1369975e2ba4e1bf73281b77bdd916508101897 /sys/powerpc/booke/pmap_32.c
parent9fa8d1582b44b4850d40699c9adb104732328b7d (diff)
downloadsrc-5a08df100b58911396e0cc1403f0504bc68461bd.tar.gz
src-5a08df100b58911396e0cc1403f0504bc68461bd.zip
Diffstat (limited to 'sys/powerpc/booke/pmap_32.c')
-rw-r--r--sys/powerpc/booke/pmap_32.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/powerpc/booke/pmap_32.c b/sys/powerpc/booke/pmap_32.c
index a9f8af0565f0..924eb223a2b6 100644
--- a/sys/powerpc/booke/pmap_32.c
+++ b/sys/powerpc/booke/pmap_32.c
@@ -748,14 +748,23 @@ mmu_booke_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
sync_sz = min(sync_sz, sz);
if (valid) {
if (!active) {
- /* Create a mapping in the active pmap. */
+ /*
+ * Create a mapping in the active pmap.
+ *
+ * XXX: We use the zero page here, because
+ * it isn't likely to be in use.
+ * If we ever decide to support
+ * security.bsd.map_at_zero on Book-E, change
+ * this to some other address that isn't
+ * normally mappable.
+ */
addr = 0;
m = PHYS_TO_VM_PAGE(pa);
PMAP_LOCK(pmap);
pte_enter(pmap, m, addr,
PTE_SR | PTE_VALID, FALSE);
- addr += (va & PAGE_MASK);
- __syncicache((void *)addr, sync_sz);
+ __syncicache((void *)(addr + (va & PAGE_MASK)),
+ sync_sz);
pte_remove(pmap, addr, PTBL_UNHOLD);
PMAP_UNLOCK(pmap);
} else