summaryrefslogtreecommitdiffstats
path: root/tools/objtool/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-03-12 12:32:55 +0100
committerBorislav Petkov <bp@suse.de>2021-03-15 16:37:37 +0100
commit301cddc21a157a3072d789a3097857202e550a24 (patch)
tree77fec47c4e9ab4fa5acd079a71bb3e60b1f805c1 /tools/objtool/arch
parenta89dfde3dc3c2dbf56910af75e2d8b11ec5308f6 (diff)
downloadlinux-301cddc21a157a3072d789a3097857202e550a24.tar.gz
linux-301cddc21a157a3072d789a3097857202e550a24.tar.bz2
linux-301cddc21a157a3072d789a3097857202e550a24.zip
objtool/x86: Use asm/nops.h
Since the kernel will rely on a single canonical set of NOPs, make sure objtool uses the exact same ones. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20210312115749.136357911@infradead.org
Diffstat (limited to 'tools/objtool/arch')
-rw-r--r--tools/objtool/arch/x86/decode.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 549813cff8ab..c117bfc60370 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -11,6 +11,9 @@
#include "../../../arch/x86/lib/inat.c"
#include "../../../arch/x86/lib/insn.c"
+#define CONFIG_64BIT 1
+#include <asm/nops.h>
+
#include <asm/orc_types.h>
#include <objtool/check.h>
#include <objtool/elf.h>
@@ -596,11 +599,11 @@ void arch_initial_func_cfi_state(struct cfi_init_state *state)
const char *arch_nop_insn(int len)
{
static const char nops[5][5] = {
- /* 1 */ { 0x90 },
- /* 2 */ { 0x66, 0x90 },
- /* 3 */ { 0x0f, 0x1f, 0x00 },
- /* 4 */ { 0x0f, 0x1f, 0x40, 0x00 },
- /* 5 */ { 0x0f, 0x1f, 0x44, 0x00, 0x00 },
+ { BYTES_NOP1 },
+ { BYTES_NOP2 },
+ { BYTES_NOP3 },
+ { BYTES_NOP4 },
+ { BYTES_NOP5 },
};
if (len < 1 || len > 5) {