Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp946556ybz; Fri, 1 May 2020 11:25:57 -0700 (PDT) X-Google-Smtp-Source: APiQypK3DIcxdU1p+K7n1amBDlFj/u7pNDeilqpbJV8+1XcBB3TJdS108n4oOQM2DBW/JXhp0TQQ X-Received: by 2002:a05:6402:17f1:: with SMTP id t17mr4712475edy.239.1588357556868; Fri, 01 May 2020 11:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588357556; cv=none; d=google.com; s=arc-20160816; b=SqFzQiNTDuADlSEMBnzRAwE3dFqfATtsX8bKIMT+77FvoWfI2njKjzpcGMNDuaSKYT TU3yaprh2UClxRcDl9K9GSAqQLJyYvCHqvECHXKFsnqczL8Tm88Xd2i7OBjd2KI4vQf/ NlCo6/M+6Pkuc+h9G+N2cNLxagOG90ZhlIgPpU8Px2RM8Yyc2+kHNC1VwTCWIfcrnroV hLbe3ALxU6Eq08SOGmHLH7ThRMvnhkM+x9k3YPKs6y8poxN2M6cafm6fs05FumLWwBaq m0ogn59pU8zETE3WANCiFUUH2NlWmj0IMPmeM0eOLxa0RqCD0aKzB9tx+Br8InOWxh8W lITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=hQmABGmEVfNOac99ES5pe6TBGpEc+H5ohVEnoHwldek=; b=mExLY4B4AdgMCt2ojkw8UZe/YXdlGm7hUSpfrTtkpbKQHjUu7Gd4axfaTxrirzMqPT hKvNXs8OudCFfSFkdU17CZS/x6WGV7qSOVVLI3L5Wx4xaybTHPpyp90SgSPpDhT1Qg6o /yEsA0itlvSgtatdkknZEjkfm7rn5SLKbpWuzUXPxjrwsbOSpQ55lGCBIl4jkXTHXul7 CLsTXm6tCb/Ne93+IDybfjN8+OH9zqtMaE6EVtYI0VSwxeT7Wf3kYuyML+KsKy/PGN+b XKbM/hSXdbvHBCUCX9pAxxRqJCy6xRaBWpIL0s3OuWCCqv4w4wPbgO/mYHwGCIzl/+Si 7sFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq11si2029083ejc.307.2020.05.01.11.25.33; Fri, 01 May 2020 11:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730931AbgEASX1 (ORCPT + 99 others); Fri, 1 May 2020 14:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730657AbgEASW1 (ORCPT ); Fri, 1 May 2020 14:22:27 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65245C061A0C; Fri, 1 May 2020 11:22:27 -0700 (PDT) Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jUaIn-0003ez-A5; Fri, 01 May 2020 20:22:21 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id E8C4F1C0330; Fri, 1 May 2020 20:22:20 +0200 (CEST) Date: Fri, 01 May 2020 18:22:20 -0000 From: "tip-bot2 for Peter Zijlstra" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] objtool: Remove INSN_STACK Cc: Julien Thierry , "Peter Zijlstra (Intel)" , Miroslav Benes , Josh Poimboeuf , x86 , LKML In-Reply-To: <20200428191659.854203028@infradead.org> References: <20200428191659.854203028@infradead.org> MIME-Version: 1.0 Message-ID: <158835734088.8414.16395422459790306018.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: b09fb65e863733e192d4825a285b4b4998969ce0 Gitweb: https://git.kernel.org/tip/b09fb65e863733e192d4825a285b4b4998969ce0 Author: Peter Zijlstra AuthorDate: Fri, 24 Apr 2020 16:18:58 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 30 Apr 2020 20:14:33 +02:00 objtool: Remove INSN_STACK With the unconditional use of handle_insn_ops(), INSN_STACK has lost its purpose. Remove it. Suggested-by: Julien Thierry Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20200428191659.854203028@infradead.org --- tools/objtool/arch.h | 1 - tools/objtool/arch/x86/decode.c | 23 ----------------------- tools/objtool/check.c | 3 --- 3 files changed, 27 deletions(-) diff --git a/tools/objtool/arch.h b/tools/objtool/arch.h index 445b8fa..25dd4a9 100644 --- a/tools/objtool/arch.h +++ b/tools/objtool/arch.h @@ -21,7 +21,6 @@ enum insn_type { INSN_RETURN, INSN_EXCEPTION_RETURN, INSN_CONTEXT_SWITCH, - INSN_STACK, INSN_BUG, INSN_NOP, INSN_STAC, diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 97e66c7..e26bedb 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -141,7 +141,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, if (rex_w && !rex_b && modrm_mod == 3 && modrm_rm == 4) { /* add/sub reg, %rsp */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_ADD; op->src.reg = op_to_cfi_reg[modrm_reg][rex_r]; @@ -154,7 +153,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x50 ... 0x57: /* push reg */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG; op->src.reg = op_to_cfi_reg[op1 & 0x7][rex_b]; @@ -166,7 +164,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x58 ... 0x5f: /* pop reg */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_POP; op->dest.type = OP_DEST_REG; @@ -178,7 +175,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x68: case 0x6a: /* push immediate */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_CONST; op->dest.type = OP_DEST_PUSH; @@ -196,7 +192,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, if (modrm == 0xe4) { /* and imm, %rsp */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_AND; op->src.reg = CFI_SP; @@ -215,7 +210,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, break; /* add/sub imm, %rsp */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_ADD; op->src.reg = CFI_SP; @@ -229,7 +223,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, if (rex_w && !rex_r && modrm_mod == 3 && modrm_reg == 4) { /* mov %rsp, reg */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG; op->src.reg = CFI_SP; @@ -242,7 +235,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, if (rex_w && !rex_b && modrm_mod == 3 && modrm_rm == 4) { /* mov reg, %rsp */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG; op->src.reg = op_to_cfi_reg[modrm_reg][rex_r]; @@ -258,7 +250,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, (modrm_mod == 1 || modrm_mod == 2) && modrm_rm == 5) { /* mov reg, disp(%rbp) */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG; op->src.reg = op_to_cfi_reg[modrm_reg][rex_r]; @@ -270,7 +261,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, } else if (rex_w && !rex_b && modrm_rm == 4 && sib == 0x24) { /* mov reg, disp(%rsp) */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG; op->src.reg = op_to_cfi_reg[modrm_reg][rex_r]; @@ -286,7 +276,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, if (rex_w && !rex_b && modrm_mod == 1 && modrm_rm == 5) { /* mov disp(%rbp), reg */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG_INDIRECT; op->src.reg = CFI_BP; @@ -299,7 +288,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, modrm_mod != 3 && modrm_rm == 4) { /* mov disp(%rsp), reg */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_REG_INDIRECT; op->src.reg = CFI_SP; @@ -314,7 +302,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x8d: if (sib == 0x24 && rex_w && !rex_b && !rex_x) { - *type = INSN_STACK; ADD_OP(op) { if (!insn.displacement.value) { /* lea (%rsp), reg */ @@ -332,7 +319,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, } else if (rex == 0x48 && modrm == 0x65) { /* lea disp(%rbp), %rsp */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_ADD; op->src.reg = CFI_BP; @@ -350,7 +336,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, * Restoring rsp back to its original value after a * stack realignment. */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_ADD; op->src.reg = CFI_R10; @@ -368,7 +353,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, * Restoring rsp back to its original value after a * stack realignment. */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_ADD; op->src.reg = CFI_R13; @@ -382,7 +366,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x8f: /* pop to mem */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_POP; op->dest.type = OP_DEST_MEM; @@ -395,7 +378,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x9c: /* pushf */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_CONST; op->dest.type = OP_DEST_PUSHF; @@ -404,7 +386,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, case 0x9d: /* popf */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_POPF; op->dest.type = OP_DEST_MEM; @@ -443,7 +424,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, } else if (op2 == 0xa0 || op2 == 0xa8) { /* push fs/gs */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_CONST; op->dest.type = OP_DEST_PUSH; @@ -452,7 +432,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, } else if (op2 == 0xa1 || op2 == 0xa9) { /* pop fs/gs */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_POP; op->dest.type = OP_DEST_MEM; @@ -469,7 +448,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, * mov bp, sp * pop bp */ - *type = INSN_STACK; ADD_OP(op) op->dest.type = OP_DEST_LEAVE; @@ -537,7 +515,6 @@ int arch_decode_instruction(const struct elf *elf, const struct section *sec, else if (modrm_reg == 6) { /* push from mem */ - *type = INSN_STACK; ADD_OP(op) { op->src.type = OP_SRC_CONST; op->dest.type = OP_DEST_PUSH; diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 6591c2d..4f3db2f 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2339,9 +2339,6 @@ static int validate_branch(struct objtool_file *file, struct symbol *func, } return 0; - case INSN_STACK: - break; - case INSN_STAC: if (state.uaccess) { WARN_FUNC("recursive UACCESS enable", sec, insn->offset);