10 Sep, 2020

3 commits


01 Sep, 2020

1 commit

  • Add the inline static call implementation for x86-64. The generated code
    is identical to the out-of-line case, except we move the trampoline into
    it's own section.

    Objtool uses the trampoline naming convention to detect all the call
    sites. It then annotates those call sites in the .static_call_sites
    section.

    During boot (and module init), the call sites are patched to call
    directly into the destination function. The temporary trampoline is
    then no longer used.

    [peterz: merged trampolines, put trampoline in section]

    Signed-off-by: Josh Poimboeuf
    Signed-off-by: Peter Zijlstra (Intel)
    Signed-off-by: Ingo Molnar
    Cc: Linus Torvalds
    Link: https://lore.kernel.org/r/20200818135804.864271425@infradead.org

    Josh Poimboeuf
     

22 Jan, 2020

1 commit

  • The sync-check.sh script prints out the path due to a "cd -" at the end
    of the script, even on silent builds. This isn't even needed, since the
    script is executed in our build instead of sourced (so it won't change
    the working directory of the surrounding build anyway).

    Just remove the cd to make the build silent.

    Fixes: 2ffd84ae973b ("objtool: Update sync-check.sh from perf's check-headers.sh")
    Signed-off-by: Olof Johansson
    Signed-off-by: Josh Poimboeuf
    Signed-off-by: Ingo Molnar
    Link: https://lore.kernel.org/r/cb002857fafa8186cfb9c3e43fb62e4108a1bab9.1579543924.git.jpoimboe@redhat.com

    Olof Johansson
     

18 Oct, 2019

1 commit

  • Decode Xen and KVM's emulate-prefix signature by x86 insn decoder.
    It is called "prefix" but actually not x86 instruction prefix, so
    this adds insn.emulate_prefix_size field instead of reusing
    insn.prefixes.

    If x86 decoder finds a special sequence of instructions of
    XEN_EMULATE_PREFIX and 'ud2a; .ascii "kvm"', it just counts the
    length, set insn.emulate_prefix_size and fold it with the next
    instruction. In other words, the signature and the next instruction
    is treated as a single instruction.

    Signed-off-by: Masami Hiramatsu
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Josh Poimboeuf
    Cc: Juergen Gross
    Cc: x86@kernel.org
    Cc: Boris Ostrovsky
    Cc: Ingo Molnar
    Cc: Stefano Stabellini
    Cc: Andrew Cooper
    Cc: Borislav Petkov
    Cc: xen-devel@lists.xenproject.org
    Cc: Randy Dunlap
    Link: https://lkml.kernel.org/r/156777564986.25081.4964537658500952557.stgit@devnote2

    Masami Hiramatsu
     

01 Sep, 2019

3 commits

  • Since we need to build this in !x86, we need to explicitely use the x86
    files, not things like asm/insn.h, so we intentionally differ from the
    master copy in the kernel sources, add -I diff directives to ignore just
    these differences when checking for drift.

    Acked-by: Josh Poimboeuf
    Link: http://lore.kernel.org/lkml/20190830193109.p7jagidsrahoa4pn@treble
    Acked-by: Masami Hiramatsu
    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/n/tip-j965m9b7xtdc83em3twfkh9o@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • To allow using the -I trick that will be needed for checking the x86
    insn decoder files.

    Without the specific -I lines we still get the same warnings as before:

    $ make -C tools/objtool/ clean ; make -C tools/objtool/
    make: Entering directory '/home/acme/git/perf/tools/objtool'
    CLEAN objtool
    find -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
    rm -f arch/x86/inat-tables.c fixdep

    LD objtool-in.o
    make[1]: Leaving directory '/home/acme/git/perf/tools/objtool'
    Warning: Kernel ABI header at 'tools/arch/x86/include/asm/inat.h' differs from latest version at 'arch/x86/include/asm/inat.h'
    diff -u tools/arch/x86/include/asm/inat.h arch/x86/include/asm/inat.h
    Warning: Kernel ABI header at 'tools/arch/x86/include/asm/insn.h' differs from latest version at 'arch/x86/include/asm/insn.h'
    diff -u tools/arch/x86/include/asm/insn.h arch/x86/include/asm/insn.h
    Warning: Kernel ABI header at 'tools/arch/x86/lib/inat.c' differs from latest version at 'arch/x86/lib/inat.c'
    diff -u tools/arch/x86/lib/inat.c arch/x86/lib/inat.c
    Warning: Kernel ABI header at 'tools/arch/x86/lib/insn.c' differs from latest version at 'arch/x86/lib/insn.c'
    diff -u tools/arch/x86/lib/insn.c arch/x86/lib/insn.c
    /home/acme/git/perf/tools/objtool
    LINK objtool
    make: Leaving directory '/home/acme/git/perf/tools/objtool'
    $

    The next patch will add the -I lines for those files.

    Acked-by: Josh Poimboeuf
    Link: http://lore.kernel.org/lkml/20190830193109.p7jagidsrahoa4pn@treble
    Acked-by: Masami Hiramatsu
    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra (Intel)
    Link: https://lkml.kernel.org/n/tip-vu3p38mnxlwd80rlsnjkqcf2@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • 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
    Reviewed-by: Masami Hiramatsu
    Acked-by: Peter Zijlstra (Intel)
    Cc: Adrian Hunter
    Cc: Jiri Olsa
    Cc: x86@kernel.org
    Link: http://lore.kernel.org/lkml/55b486b88f6bcd0c9a2a04b34f964860c8390ca8.1567118001.git.jpoimboe@redhat.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Josh Poimboeuf
     

07 Nov, 2017

1 commit

  • Replace the nasty diff checks in the objtool Makefile with a clean bash
    script, and make the warnings more specific.

    Heavily inspired by tools/perf/check-headers.sh.

    Suggested-by: Ingo Molnar
    Signed-off-by: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/ab015f15ccd8c0c6008493c3c6ee3d495eaf2927.1509974346.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf