linux-uconsole/tools/include
Borislav Petkov 6bc6875b82 x86/insn: Add an insn_decode() API
commit 93281c4a96 upstream.

Users of the instruction decoder should use this to decode instruction
bytes. For that, have insn*() helpers return an int value to denote
success/failure. When there's an error fetching the next insn byte and
the insn falls short, return -ENODATA to denote that.

While at it, make insn_get_opcode() more stricter as to whether what has
seen so far is a valid insn and if not.

Copy linux/kconfig.h for the tools-version of the decoder so that it can
use IS_ENABLED().

Also, cast the INSN_MODE_KERN dummy define value to (enum insn_mode)
for tools use of the decoder because perf tool builds with -Werror and
errors out with -Werror=sign-compare otherwise.

Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lkml.kernel.org/r/20210304174237.31945-5-bp@alien8.de
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-25 11:26:11 +02:00
..
asm tools: Add missing stdio.h include to asm/bug.h header 2019-09-25 09:51:44 -03:00
asm-generic treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
linux x86/insn: Add an insn_decode() API 2022-07-25 11:26:11 +02:00
nolibc tools/nolibc: fix incorrect truncation of exit code 2022-01-27 10:53:42 +01:00
tools
trace/events
uapi bpf: Fix comment for helper bpf_current_task_under_cgroup() 2022-04-08 14:40:43 +02:00
vdso tools headers: Synchronize linux/bits.h with the kernel sources 2020-04-14 11:40:05 -03:00