diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2015-12-30 02:26:04 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2015-12-30 02:26:04 +0000 |
commit | 2905d447cf9e6c71ffcf3816867e2712070364de (patch) | |
tree | 6cf6eebda3edc07e6e69bc7ad1a6fe6f5df49b7e /sys/powerpc/booke/pmap.c | |
parent | 3d2aea56f4043bf704308110ea3a1053ffb02dd6 (diff) | |
download | FreeBSD-src-2905d447cf9e6c71ffcf3816867e2712070364de.zip FreeBSD-src-2905d447cf9e6c71ffcf3816867e2712070364de.tar.gz |
Optimize zero_page for book-e mmu.
Instead of indirectly calling bzero() through mmu_booke_zero_page_area, zero the
full page the same way as the AIM pmap logic does: using dcbz.
Diffstat (limited to 'sys/powerpc/booke/pmap.c')
-rw-r--r-- | sys/powerpc/booke/pmap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 6d720a1..bb1a7b5 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -2235,8 +2235,17 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_page_t m, int off, int size) static void mmu_booke_zero_page(mmu_t mmu, vm_page_t m) { + vm_offset_t off, va; - mmu_booke_zero_page_area(mmu, m, 0, PAGE_SIZE); + mtx_lock(&zero_page_mutex); + va = zero_page_va; + + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbzl 0,%0" :: "r"(va + off)); + mmu_booke_kremove(mmu, va); + + mtx_unlock(&zero_page_mutex); } /* |