aboutsummaryrefslogtreecommitdiffstats
path: root/tools/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-03-26 16:12:00 +0100
committerBorislav Petkov <bp@suse.de>2021-03-31 16:20:22 +0200
commit52fa82c21f64e900a72437269a5cc9e0034b424e (patch)
treeb2a122854db8fa1ed6adc80be5e5dee1dc3ab22f /tools/arch
parentx86/kprobes: Move 'inline' to the beginning of the kprobe_is_ss() declaration (diff)
downloadlinux-dev-52fa82c21f64e900a72437269a5cc9e0034b424e.tar.xz
linux-dev-52fa82c21f64e900a72437269a5cc9e0034b424e.zip
x86: Add insn_decode_kernel()
Add a helper to decode kernel instructions; there's no point in endlessly repeating those last two arguments. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20210326151259.379242587@infradead.org
Diffstat (limited to 'tools/arch')
-rw-r--r--tools/arch/x86/include/asm/insn.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/arch/x86/include/asm/insn.h b/tools/arch/x86/include/asm/insn.h
index c9f3eeebb53b..dc632b41f135 100644
--- a/tools/arch/x86/include/asm/insn.h
+++ b/tools/arch/x86/include/asm/insn.h
@@ -150,6 +150,8 @@ enum insn_mode {
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
+#define insn_decode_kernel(_insn, _ptr) insn_decode((_insn), (_ptr), MAX_INSN_SIZE, INSN_MODE_KERN)
+
/* Attribute will be determined after getting ModRM (for opcode groups) */
static inline void insn_get_attribute(struct insn *insn)
{