From 72e58595b176dc9903f974f702e91e1dbce2aedf Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Thu, 23 May 2019 03:40:48 +0000 Subject: [PATCH] powerpc/booke: It helps to set variables before using them Actually set the source and destination VA's before using them. Fixes a bizarre panic on 32-bit Book-E. Not sure why this wasn't caught by the compiler. --- sys/powerpc/booke/pmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 5448770b178..93c1e24880d 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -3043,11 +3043,12 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t dm) dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); #else + sva = copy_page_src_va; + dva = copy_page_dst_va; + mtx_lock(©_page_mutex); mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); - sva = copy_page_src_va; - dva = copy_page_dst_va; memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE);