powerpc/64s: Avoid a branch for ppc_msgsnd
authorNicholas Piggin <npiggin@gmail.com>
Thu, 13 Apr 2017 10:16:23 +0000 (20:16 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 13 Apr 2017 13:34:34 +0000 (23:34 +1000)
IPIs are a pretty hot path and we already have the ability to do asm feature
patching, so use it.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Change log detail]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/dbell.h

index 350694a1a6e592761bcdfba93b4c004465698574..040944659a202430c30dfd6a0c17969a02af3f4f 100644 (file)
@@ -38,10 +38,8 @@ enum ppc_dbell {
 
 static inline void _ppc_msgsnd(u32 msg)
 {
-       if (cpu_has_feature(CPU_FTR_HVMODE))
-               __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
-       else
-               __asm__ __volatile__ (PPC_MSGSNDP(%0) : : "r" (msg));
+       __asm__ __volatile__ (ASM_FTR_IFSET(PPC_MSGSND(%1), PPC_MSGSNDP(%1), %0)
+                               : : "i" (CPU_FTR_HVMODE), "r" (msg));
 }
 
 /* sync before sending message */