From: Linus Torvalds Date: Wed, 28 Apr 2021 19:53:24 +0000 (-0700) Subject: Merge tag 'objtool-core-2021-04-28' of git://git.kernel.org/pub/scm/linux/kernel... X-Git-Tag: accepted/tizen/unified/20230118.172025~7361 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03b2cd72aad1103127282f39c614e4722e5d9e8f;p=platform%2Fkernel%2Flinux-rpi.git Merge tag 'objtool-core-2021-04-28' of git://git./linux/kernel/git/tip/tip Pull objtool updates from Ingo Molnar: - Standardize the crypto asm code so that it looks like compiler- generated code to objtool - so that it can understand it. This enables unwinding from crypto asm code - and also fixes the last known remaining objtool warnings for LTO and more. - x86 decoder fixes: clean up and fix the decoder, and also extend it a bit - Misc fixes and cleanups * tag 'objtool-core-2021-04-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) x86/crypto: Enable objtool in crypto code x86/crypto/sha512-ssse3: Standardize stack alignment prologue x86/crypto/sha512-avx2: Standardize stack alignment prologue x86/crypto/sha512-avx: Standardize stack alignment prologue x86/crypto/sha256-avx2: Standardize stack alignment prologue x86/crypto/sha1_avx2: Standardize stack alignment prologue x86/crypto/sha_ni: Standardize stack alignment prologue x86/crypto/crc32c-pcl-intel: Standardize jump table x86/crypto/camellia-aesni-avx2: Unconditionally allocate stack buffer x86/crypto/aesni-intel_avx: Standardize stack alignment prologue x86/crypto/aesni-intel_avx: Fix register usage comments x86/crypto/aesni-intel_avx: Remove unused macros objtool: Support asm jump tables objtool: Parse options from OBJTOOL_ARGS objtool: Collate parse_options() users objtool: Add --backup objtool,x86: More ModRM sugar objtool,x86: Rewrite ADD/SUB/AND objtool,x86: Support %riz encodings objtool,x86: Simplify register decode ... --- 03b2cd72aad1103127282f39c614e4722e5d9e8f diff --cc tools/objtool/arch/x86/decode.c index 7e8b5be,431bafb..cedf3ed --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@@ -19,19 -16,7 +19,8 @@@ #include #include #include +#include - static unsigned char op_to_cfi_reg[][2] = { - {CFI_AX, CFI_R8}, - {CFI_CX, CFI_R9}, - {CFI_DX, CFI_R10}, - {CFI_BX, CFI_R11}, - {CFI_SP, CFI_R12}, - {CFI_BP, CFI_R13}, - {CFI_SI, CFI_R14}, - {CFI_DI, CFI_R15}, - }; - static int is_x86_64(const struct elf *elf) { switch (elf->ehdr.e_machine) { @@@ -94,12 -104,14 +108,14 @@@ int arch_decode_instruction(const struc struct list_head *ops_list) { struct insn insn; - int x86_64, sign, ret; - unsigned char op1, op2, rex = 0, rex_b = 0, rex_r = 0, rex_w = 0, - rex_x = 0, modrm = 0, modrm_mod = 0, modrm_rm = 0, - modrm_reg = 0, sib = 0; - int x86_64; ++ int x86_64, ret; + unsigned char op1, op2, + rex = 0, rex_b = 0, rex_r = 0, rex_w = 0, rex_x = 0, + modrm = 0, modrm_mod = 0, modrm_rm = 0, modrm_reg = 0, + sib = 0, /* sib_scale = 0, */ sib_index = 0, sib_base = 0; struct stack_op *op = NULL; struct symbol *sym; + u64 imm; x86_64 = is_x86_64(elf); if (x86_64 == -1) diff --cc tools/objtool/check.c index 1f4154f,46621e8..9ed1a4c --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@@ -2449,12 -2434,9 +2444,12 @@@ static int handle_insn_ops(struct instr list_for_each_entry(op, &insn->stack_ops, list) { - if (update_cfi_state(insn, &state->cfi, op)) + if (update_cfi_state(insn, next_insn, &state->cfi, op)) return 1; + if (!insn->alt_group) + continue; + if (op->dest.type == OP_DEST_PUSHF) { if (!state->uaccess_stack) { state->uaccess_stack = 1; diff --cc tools/objtool/objtool.c index 3a3ea1b,43c1836..e21db8b --- a/tools/objtool/objtool.c +++ b/tools/objtool/objtool.c @@@ -59,9 -118,13 +118,14 @@@ struct objtool_file *objtool_open_read( if (!file.elf) return NULL; + if (backup && !objtool_create_backup(objname)) { + WARN("can't create backup file"); + return NULL; + } + INIT_LIST_HEAD(&file.insn_list); hash_init(file.insn_hash); + INIT_LIST_HEAD(&file.retpoline_call_list); INIT_LIST_HEAD(&file.static_call_list); INIT_LIST_HEAD(&file.mcount_loc_list); file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment");