Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5378403iog; Wed, 22 Jun 2022 18:54:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1spcH73dGtUy49YEd++OEI0ZZ/C10vvxyyZfHb/ADL5lUqH/Kr/38nKSL1Gpg+z8zBttkzJ X-Received: by 2002:a17:90a:784f:b0:1ea:fa7d:7013 with SMTP id y15-20020a17090a784f00b001eafa7d7013mr1387537pjl.222.1655949268337; Wed, 22 Jun 2022 18:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655949268; cv=none; d=google.com; s=arc-20160816; b=q1lw20D+rVVVVH0VsSbrPiRujCDLCzMzzW+nnZgEKS7z7aY2QhpLpyIpain2YGGOvY kXp8sdYyfnVVG6IPY/JCcpwsPlWhYbQkwZT7T/xpk5WPZHl++T8k0pY6zSnfwgiTU/B9 XqOnz5Cl60oHHkdJQdvYwUAsncOg9TXUPrCkJTo06OBkP8vbhXP7xZZqRy2WDmHwXu5C tGYZvY+1IYVAJYxCZbYJeGpIX1cHrETcZOdgdKOfRaRoFo0m3AdqiLA9Xwpeyd7/De2c h0btV8onb3qkQwULwqL80nBj138ly6XwRWQWWUl3tmwm+X4gxNTKcdyZUcFqwC7Sprbw WwFw== 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=YedkUEnuae2N5lI9G2weY7HBGRg9iew8rJxMmd7KxhE=; b=bW3ZmqEA8JJeIJ0RtzhHyWV765quHqeQsTXHT4J6aiuemvRI7HqnuSSOUf8EIZBKG0 WIHinmsIkpoNr91nK6ksU+ztiPRvByfRt9wfbwFKNZfQyjXfTWjBW4J/5FN874BT7FIK 0gOTxsUdv8ZLBClGnuHfWab0HjJ3f6lMaxuKh1Xx25V4wueXj4c/RzIAXp5flEpbgwVA SA+a7LIvW+1eejaojWrrkODE61N6pOw9lOHQ7dC4szMCkKTCOrNoxem1pT4/AfhETpnK 5gwEl/A3ho1EIQ0mc9dJhy/ewooeWnVlNnOCJNU7lxNAqF2+BiC0LHVkAO1YY2a2pa0Z gIFA== 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 m25-20020a62a219000000b0051054f9373esi25057151pff.165.2022.06.22.18.54.16; Wed, 22 Jun 2022 18:54:28 -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 S1377949AbiFWBxD (ORCPT + 99 others); Wed, 22 Jun 2022 21:53:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235469AbiFWBwH (ORCPT ); Wed, 22 Jun 2022 21:52:07 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B405243ACC; Wed, 22 Jun 2022 18:51:50 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LT38h68Xpz1KBY6; Thu, 23 Jun 2022 09:49:40 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500020.china.huawei.com (7.185.36.49) 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:48 +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:48 +0800 From: Chen Zhongjin To: , , , , , CC: , , , , , , , , , , , , , , Subject: [PATCH v6 14/33] objtool: arm64: Add annotate_reachable() for objtools Date: Thu, 23 Jun 2022 09:48:58 +0800 Message-ID: <20220623014917.199563-15-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 x86 removed annotate_reachable and replaced it with ASM_REACHABLE which is not suitable for arm64 micro because there are some cases GCC will merge duplicate inline asm. Re-add annotation_reachable() for arm64. Signed-off-by: Chen Zhongjin --- include/linux/compiler.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 01ce94b58b42..c8bce9421fa7 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -117,6 +117,14 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, */ #define __stringify_label(n) #n +#define __annotate_reachable(c) ({ \ + asm volatile(__stringify_label(c) ":\n\t" \ + ".pushsection .discard.reachable\n\t" \ + ".long " __stringify_label(c) "b - .\n\t" \ + ".popsection\n\t"); \ +}) +#define annotate_reachable() __annotate_reachable(__COUNTER__) + #define __annotate_unreachable(c) ({ \ asm volatile(__stringify_label(c) ":\n\t" \ ".pushsection .discard.unreachable\n\t" \ @@ -129,6 +137,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, #define __annotate_jump_table __section(".rodata..c_jump_table") #else /* !CONFIG_OBJTOOL */ +#define annotate_reachable() #define annotate_unreachable() #define __annotate_jump_table #endif /* CONFIG_OBJTOOL */ -- 2.17.1