powerpc/smp: Use code patching to restore reset vector
authorChristophe Leroy <christophe.leroy@c-s.fr>
Fri, 9 Nov 2018 17:33:32 +0000 (17:33 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 19 Dec 2018 07:56:32 +0000 (18:56 +1100)
Instead of hardcoding reset vector restore, use patch_instruction()

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/86xx/mpc86xx_smp.c
arch/powerpc/platforms/powermac/smp.c

index 020e84a47a32f925bf9fefda4a4e9db353cab628..9f2c1ecc85c394b83c5692e97653e39eae509c41 100644 (file)
@@ -86,8 +86,7 @@ smp_86xx_kick_cpu(int nr)
                mdelay(1);
 
        /* Restore the exception vector */
-       *vector = save_vector;
-       flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
+       patch_instruction(vector, save_vector);
 
        local_irq_restore(flags);
 
index 447da6db450a3ce1fc59eb519d60831f9daa273e..35be6e0b886df1e84916a97e6db1495206eabc25 100644 (file)
@@ -832,8 +832,7 @@ static int smp_core99_kick_cpu(int nr)
        mdelay(1);
 
        /* Restore our exception vector */
-       *vector = save_vector;
-       flush_icache_range((unsigned long) vector, (unsigned long) vector + 4);
+       patch_instruction(vector, save_vector);
 
        local_irq_restore(flags);
        if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);