]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/traps: Start using PPC_RAW_xx() macros
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 20 May 2021 10:23:10 +0000 (10:23 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 15 Jun 2021 14:16:48 +0000 (00:16 +1000)
Start using PPC_RAW_xx() macros where relevant.

PPC_INST_SYNC is used to both represent the 'sync' instruction and
the family of synchronisation instructions. Keep it for the later,
maybe we'll change the name in the future to avoid confusion.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0945c155d6cb113431185fc1296ac127359fe29b.1621506159.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/ppc-opcode.h
arch/powerpc/kernel/traps.c

index 34ee13fb931509c0291383dce4e9f8e32bc7af73..615846e631faf9fe1eb81f6570acfafe357fcd4e 100644 (file)
 #define PPC_INST_LWSYNC                        0x7c2004ac
 #define PPC_INST_SYNC                  0x7c0004ac
 #define PPC_INST_SYNC_MASK             0xfc0007fe
-#define PPC_INST_ISYNC                 0x4c00012c
 #define PPC_INST_MCRXR                 0x7c000400
 #define PPC_INST_MCRXR_MASK            0xfc0007fe
 #define PPC_INST_MFSPR_PVR             0x7c1f42a6
index b4ab95c9e94a89c2f94cd2ea2b68720580492e99..c929d93c35d0cd3c305e97ce97ba481f8a37704b 100644 (file)
@@ -67,6 +67,7 @@
 #include <asm/kprobes.h>
 #include <asm/stacktrace.h>
 #include <asm/nmi.h>
+#include <asm/disassemble.h>
 
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE)
 int (*__debugger)(struct pt_regs *regs) __read_mostly;
@@ -537,11 +538,11 @@ static inline int check_io_access(struct pt_regs *regs)
                 * For the debug message, we look at the preceding
                 * load or store.
                 */
-               if (*nip == PPC_INST_NOP)
+               if (*nip == PPC_RAW_NOP())
                        nip -= 2;
-               else if (*nip == PPC_INST_ISYNC)
+               else if (*nip == PPC_RAW_ISYNC())
                        --nip;
-               if (*nip == PPC_INST_SYNC || (*nip >> 26) == OP_TRAP) {
+               if (*nip == PPC_RAW_SYNC() || get_op(*nip) == OP_TRAP) {
                        unsigned int rb;
 
                        --nip;