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 020e84a..9f2c1ec 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 447da6d..35be6e0 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);