OSDN Git Service

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 8815823..8c9b9ad 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 b998412..7c50040 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 0567c47..a62e032 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 1470e74..66f1575 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'"
 }