Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5390777iog; Wed, 22 Jun 2022 19:12:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u48qhjbLoZ7TT8Ci8V0v03ieP5VBvAm1tqmA2Az4Bu4AgJ7YSonhtpcNWNQImgt+l/X2Zf X-Received: by 2002:a17:90a:e503:b0:1ec:84b2:6404 with SMTP id t3-20020a17090ae50300b001ec84b26404mr1452850pjy.169.1655950343316; Wed, 22 Jun 2022 19:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655950343; cv=none; d=google.com; s=arc-20160816; b=QEcdeTKrJd48deaGqGdf8UgA4w75Y+oE7pdAkSHprIb7tHBXGKLkt2A7LaU+TLOT3U iI6U1e9MHQR+LH5DPdM7HMNPfqYUfYhqxktgz7E4BLGGeCxqon/kIyHoALmkxbjwgSfj /O+3AowOAyAgzEQYN0QEwlgMGDKVPmbOIXZpsFQlQ/PLIkgK3xQ24Rlqls/GZu4xlz1l gw9EiIKgVoBt+Ygo1p+3Tqc++xqtRYTBpvqBL9DzEfg5G+L9C8uFoyFGruqKwrvwS1Bp yCj3MQcDQbz9UtTo/EHhW/31Jll+QAi7diJMA6Z7cvcK53bHnE0kbSZ332qURKHAwMfI cM3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=PAdIVDGuI5ak8gqS0838nqabsGZ21XsSHmcPQuV2C2k=; b=Ow3JlJGDvAscbhzJZSQKl4BV+oYB6P45zVkQj9vlIhbvSLIEH6v039k0dk46IvlIom t7jg7RzpgAx+QeX10UPgNRYNE6wKoP5RvuyUCJyGQ/h9kgbFcJcAJhkWMgxpyZ9NnKTN oX53IeAJxkPsLJnue+nK3FZmvASTdkeHtTLvHAEJV49CURiWqA6oMsffcDwZSbjyGzwQ XWp+zDT2jjQBkGKBKZdI2+Tkdo8Q+PGFxWj1qrQlNrAxqC1crP7wieFP0vfSHySex3lB Yq9WnOVEvtYJQ3c+BGI/4ozgrz1IudVEPfqH2M/pCO402dIhft2UAgMhhPTql+463e1q V/4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a654042000000b00408aa327347si23447031pgp.426.2022.06.22.19.12.11; Wed, 22 Jun 2022 19:12:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377389AbiFWBwA (ORCPT + 99 others); Wed, 22 Jun 2022 21:52:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377251AbiFWBvu (ORCPT ); Wed, 22 Jun 2022 21:51:50 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA8E43ACF; Wed, 22 Jun 2022 18:51:48 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LT37B0xJFzShC5; Thu, 23 Jun 2022 09:48:22 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 09:51:46 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 23 Jun 2022 09:51:46 +0800 From: Chen Zhongjin To: , , , , , CC: , , , , , , , , , , , , , , Subject: [PATCH v6 05/33] objtool: arm64: Decode other system instructions Date: Thu, 23 Jun 2022 09:48:49 +0800 Message-ID: <20220623014917.199563-6-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220623014917.199563-1-chenzhongjin@huawei.com> References: <20220623014917.199563-1-chenzhongjin@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Decode ERET, BRK and NOPs Signed-off-by: Julien Thierry Signed-off-by: Chen Zhongjin --- tools/objtool/arch/arm64/decode.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/objtool/arch/arm64/decode.c b/tools/objtool/arch/arm64/decode.c index 40ada17d0842..19840862f3aa 100644 --- a/tools/objtool/arch/arm64/decode.c +++ b/tools/objtool/arch/arm64/decode.c @@ -231,6 +231,14 @@ int arch_decode_instruction(struct objtool_file *file, const struct section *sec /* Remaining branch opcodes are conditional */ *type = INSN_JUMP_CONDITIONAL; *immediate = aarch64_get_branch_offset(insn); + } else if (aarch64_insn_is_eret(insn)) { + *type = INSN_CONTEXT_SWITCH; + } else if (aarch64_insn_is_hint(insn) || + aarch64_insn_is_barrier(insn)) { + *type = INSN_NOP; + } else if (aarch64_insn_is_brk(insn)) { + *type = INSN_BUG; + *immediate = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_16, insn); } break; default: -- 2.17.1