From a1b4155638a33ca94f6883ce038586bbcff1ad2b Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Mon, 11 Nov 2013 17:37:50 +0000 Subject: Follow up r223485, which made AIM use the ABI thread pointer instead of PCPU fields for curthread, by doing the same to Book-E. This closes some potential races switching between CPUs. As a side effect, it turns out the AIM and Book-E swtch.S implementations were the same to within a few registers, so move that to powerpc/powerpc. MFC after: 3 months --- sys/powerpc/booke/pmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/powerpc/booke/pmap.c') diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 6d943c9..a271b99 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -100,8 +100,6 @@ __FBSDID("$FreeBSD$"); #define TODO panic("%s: not implemented", __func__); -extern struct mtx sched_lock; - extern int dumpsys_minidump; extern unsigned char _etext[]; @@ -1906,7 +1904,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td) KASSERT((pmap != kernel_pmap), ("mmu_booke_activate: kernel_pmap!")); - mtx_lock_spin(&sched_lock); + sched_pin(); cpuid = PCPU_GET(cpuid); CPU_SET_ATOMIC(cpuid, &pmap->pm_active); @@ -1919,7 +1917,7 @@ mmu_booke_activate(mmu_t mmu, struct thread *td) mtspr(SPR_PID0, pmap->pm_tid[cpuid]); __asm __volatile("isync"); - mtx_unlock_spin(&sched_lock); + sched_unpin(); CTR3(KTR_PMAP, "%s: e (tid = %d for '%s')", __func__, pmap->pm_tid[PCPU_GET(cpuid)], td->td_proc->p_comm); -- cgit v1.1