]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
objtool: Move x86 insn decoder to a common location
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 29 Aug 2019 22:41:18 +0000 (17:41 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 1 Sep 2019 01:27:52 +0000 (22:27 -0300)
The kernel tree has three identical copies of the x86 instruction
decoder.  Two of them are in the tools subdir.

The tools subdir is supposed to be completely standalone and separate
from the kernel.  So having at least one copy of the kernel decoder in
the tools subdir is unavoidable.  However, we don't need *two* of them.

Move objtool's copy of the decoder to a shared location, so that perf
will also be able to use it.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: x86@kernel.org
Link: http://lore.kernel.org/lkml/55b486b88f6bcd0c9a2a04b34f964860c8390ca8.1567118001.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
12 files changed:
tools/arch/x86/include/asm/inat.h [moved from tools/objtool/arch/x86/include/asm/inat.h with 100% similarity]
tools/arch/x86/include/asm/inat_types.h [moved from tools/objtool/arch/x86/include/asm/inat_types.h with 100% similarity]
tools/arch/x86/include/asm/insn.h [moved from tools/objtool/arch/x86/include/asm/insn.h with 100% similarity]
tools/arch/x86/include/asm/orc_types.h [moved from tools/objtool/arch/x86/include/asm/orc_types.h with 100% similarity]
tools/arch/x86/lib/inat.c [moved from tools/objtool/arch/x86/lib/inat.c with 100% similarity]
tools/arch/x86/lib/insn.c [moved from tools/objtool/arch/x86/lib/insn.c with 100% similarity]
tools/arch/x86/lib/x86-opcode-map.txt [moved from tools/objtool/arch/x86/lib/x86-opcode-map.txt with 100% similarity]
tools/arch/x86/tools/gen-insn-attr-x86.awk [moved from tools/objtool/arch/x86/tools/gen-insn-attr-x86.awk with 100% similarity]
tools/objtool/Makefile
tools/objtool/arch/x86/Build
tools/objtool/arch/x86/decode.c
tools/objtool/sync-check.sh

index 88158239622bce38a7f27fb718123b8a62e03d09..8c9b9adc67ef49a3601f2938d9396573652e5195 100644 (file)
@@ -33,7 +33,7 @@ all: $(OBJTOOL)
 
 INCLUDES := -I$(srctree)/tools/include \
            -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
-           -I$(srctree)/tools/objtool/arch/$(ARCH)/include
+           -I$(srctree)/tools/arch/$(ARCH)/include
 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
 CFLAGS   += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
 LDFLAGS  += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
@@ -60,7 +60,7 @@ $(LIBSUBCMD): fixdep FORCE
 clean:
        $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
        $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
-       $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
+       $(Q)$(RM) $(OUTPUT)arch/x86/inat-tables.c $(OUTPUT)fixdep
 
 FORCE:
 
index b998412c017d9173d27b10a760899fd0c9efa32f..7c5004008e974156194f5ab185305dfbeafc4ae0 100644 (file)
@@ -1,7 +1,7 @@
 objtool-y += decode.o
 
-inat_tables_script = arch/x86/tools/gen-insn-attr-x86.awk
-inat_tables_maps = arch/x86/lib/x86-opcode-map.txt
+inat_tables_script = ../arch/x86/tools/gen-insn-attr-x86.awk
+inat_tables_maps = ../arch/x86/lib/x86-opcode-map.txt
 
 $(OUTPUT)arch/x86/lib/inat-tables.c: $(inat_tables_script) $(inat_tables_maps)
        $(call rule_mkdir)
index 0567c47a91b1024c5171460f30c8100852837f0d..a62e032863a89dbd2941739317ea2778e752f294 100644 (file)
@@ -8,8 +8,8 @@
 
 #define unlikely(cond) (cond)
 #include <asm/insn.h>
-#include "lib/inat.c"
-#include "lib/insn.c"
+#include "../../../arch/x86/lib/inat.c"
+#include "../../../arch/x86/lib/insn.c"
 
 #include "../../elf.h"
 #include "../../arch.h"
index 1470e74e9d661184e967389f8fa09c6deeff560d..66f1575b80f37a828f28474bb6b23af35f4936c9 100755 (executable)
@@ -2,21 +2,21 @@
 # SPDX-License-Identifier: GPL-2.0
 
 FILES='
-arch/x86/lib/insn.c
-arch/x86/lib/inat.c
-arch/x86/lib/x86-opcode-map.txt
-arch/x86/tools/gen-insn-attr-x86.awk
-arch/x86/include/asm/insn.h
 arch/x86/include/asm/inat.h
 arch/x86/include/asm/inat_types.h
+arch/x86/include/asm/insn.h
 arch/x86/include/asm/orc_types.h
+arch/x86/lib/inat.c
+arch/x86/lib/insn.c
+arch/x86/lib/x86-opcode-map.txt
+arch/x86/tools/gen-insn-attr-x86.awk
 '
 
 check()
 {
        local file=$1
 
-       diff $file ../../$file > /dev/null ||
+       diff ../$file ../../$file > /dev/null ||
                echo "Warning: synced file at 'tools/objtool/$file' differs from latest kernel version at '$file'"
 }