powerpc/32s: fix flush_hash_pages() on SMP
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 9 May 2019 12:59:38 +0000 (12:59 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 14 May 2019 12:58:52 +0000 (22:58 +1000)
flush_hash_pages() runs with data translation off, so current
task_struct has to be accesssed using physical address.

Fixes: f7354ccac844 ("powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU")
Cc: stable@vger.kernel.org # v5.1+
Reported-by: Erhard F. <erhard_f@mailbox.org>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/book3s32/hash_low.S

index e27792d0b744478cbb23718dd30d67bda78fd3b4..8366c2abeafcf97d1743d7bae161e823f66ed10d 100644 (file)
@@ -539,7 +539,8 @@ _GLOBAL(flush_hash_pages)
 #ifdef CONFIG_SMP
        lis     r9, (mmu_hash_lock - PAGE_OFFSET)@ha
        addi    r9, r9, (mmu_hash_lock - PAGE_OFFSET)@l
-       lwz     r8,TASK_CPU(r2)
+       tophys  (r8, r2)
+       lwz     r8, TASK_CPU(r8)
        oris    r8,r8,9
 10:    lwarx   r0,0,r9
        cmpi    0,r0,0