Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp687429iog; Fri, 24 Jun 2022 11:45:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vAObTV6dQTlSoSYQgxF+1pWA8NH8mRZEfV5cXkL8DqGJHRtuVTrVlMpi8jKpNQxfsp8TZS X-Received: by 2002:a05:6a00:2148:b0:4fa:92f2:bae3 with SMTP id o8-20020a056a00214800b004fa92f2bae3mr345902pfk.69.1656096314433; Fri, 24 Jun 2022 11:45:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656096314; cv=none; d=google.com; s=arc-20160816; b=OGsnYaab9PF0fAnSkiE2l+b2kdkYu6pho7UsUeV3r/CQWJm5M1lUNdnE5DwPZFppar WgqgkB+kAjw8NM3PTtUaJOLjyXBqyxxM867rIsh45ajiB5K7TW284bB3xuhB+0Bt69wt EIC/ZZIhWWsklOyX5h3aklmgm6a41zw87PxuEdPni3zYL967YZjyntT5dCb6gxsEJOXe cG/FyD2XtfASK1/R7ptI7gw7b4jvF4snOIo95TB2+ISl1JZrZOJYFaD3L/GOMHRTWdcD QNp4o6k+mfN0iiov4K985e/NDTXcJN+OTWAfApLAa2dnycCFltZoaqHJfnuBAxOR53N5 iYLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5n/kbbwmVtiDducCA0pI1CxpPR9FC2WdELyFBwcGRw0=; b=QjeY0ps6SSDPVLr/agl6lIAyNju1vGT/qnfDpTTgPf641FoShnyrxlrgoUlODGbArn hdsXldz2iFvlr+yJUWrhlDl5Cvz+BGQuKH5maNFBO8YpTXSMA/mL9A3OWC1cHgei5lxk eF1UscvLlMoITBqzZgrXVPsf18MfDaHWpW55OFYp9WIAbG/JbvgiJu5vfqRqZf7q/VKT s6Dx5Swtw2sp9adn6eYl6pImnys2o8qg+CqwqZdBXMnp9yN14M/o+XqXgLjWMAGVxtmz 4BmPFbBz/alECb0aYnx/W2wDYSK6XTpFLQmgt5+iZ4X74NyyS4Ky7xPa7EHD+m1NHOfH 8JRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="KqTs/m0+"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020a637c1b000000b003fc4d7e5410si2589085pgc.850.2022.06.24.11.44.57; Fri, 24 Jun 2022 11:45:14 -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; dkim=pass header.i=@ibm.com header.s=pp1 header.b="KqTs/m0+"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbiFXSe2 (ORCPT + 99 others); Fri, 24 Jun 2022 14:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiFXSe0 (ORCPT ); Fri, 24 Jun 2022 14:34:26 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A76C81273 for ; Fri, 24 Jun 2022 11:34:16 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25OIPttW000986; Fri, 24 Jun 2022 18:33:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=5n/kbbwmVtiDducCA0pI1CxpPR9FC2WdELyFBwcGRw0=; b=KqTs/m0++SqIbQlrxKA72kyH7wadEGXg1jRfrYMRSeIoBqOIjMitPqhNrkM8VDqSN695 MV9H8BXsn151kIQC8G6zUghL7i4Feb02Gcx54uBhK3pP639RO6c8F3Ig+urtFlwuAfXt O50wdbJk7n6SiAULBWAtt1g1a14hk3nTk9eRw2oPnXnV7sm4whrdY9VlUGz6VUmkl9tH w79D7vjdDmEg4K9lWo+HlrHrSFQjiX/C1oP+E4mGEpcA1rNxCUzY29FuNr9Aj1JAHd9p j3DICmCBHJWn1MX05xsawN7NKJx6D9EGgw46wTY5KU7/4wSNx3dj6DAT6XoZqtzbRojC nw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gwjhur5w8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2022 18:33:54 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 25OIS6B7011188; Fri, 24 Jun 2022 18:33:54 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gwjhur5uy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2022 18:33:54 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25OIJR39019226; Fri, 24 Jun 2022 18:33:51 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 3gvtjp9fmp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2022 18:33:51 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25OIXm0w20775268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 24 Jun 2022 18:33:48 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D688352052; Fri, 24 Jun 2022 18:33:48 +0000 (GMT) Received: from li-c3569c4c-1ef8-11b2-a85c-ee139cda3133.ibm.com.com (unknown [9.43.0.85]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 244605204E; Fri, 24 Jun 2022 18:33:44 +0000 (GMT) From: Sathvika Vasireddy To: linuxppc-dev@lists.ozlabs.org Cc: jpoimboe@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, aik@ozlabs.ru, mpe@ellerman.id.au, christophe.leroy@csgroup.eu, mingo@redhat.com, rostedt@goodmis.org, naveen.n.rao@linux.vnet.ibm.com, sv@linux.ibm.com, mbenes@suse.cz, benh@kernel.crashing.org, paulus@samba.org Subject: [RFC PATCH v3 08/12] objtool: Add arch specific function arch_ftrace_match() Date: Sat, 25 Jun 2022 00:02:34 +0530 Message-Id: <20220624183238.388144-9-sv@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220624183238.388144-1-sv@linux.ibm.com> References: <20220624183238.388144-1-sv@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 4ZHAoHhxyDNA1h6_ZBIMKsPkX9DcUvkV X-Proofpoint-GUID: e7EBk8aVeCs_-T1LeInehUFzFdR1Yf4R X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-24_08,2022-06-23_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206240072 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 Add architecture specific function to look for relocation records pointing to arch specific symbols. Suggested-by: Christophe Leroy Signed-off-by: Sathvika Vasireddy --- tools/objtool/arch/x86/decode.c | 8 ++++++++ tools/objtool/check.c | 2 +- tools/objtool/include/objtool/arch.h | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 8b990a52aada..6a66b0c0dd2c 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -23,6 +23,14 @@ #include #include +bool arch_ftrace_match(char *name) +{ + if (!strcmp(func->name, "__fentry__")) + return true; + + return false; +} + static int is_x86_64(const struct elf *elf) { switch (elf->ehdr.e_machine) { diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 88f68269860e..51b6dcec8d6a 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2185,7 +2185,7 @@ static int classify_symbols(struct objtool_file *file) if (arch_is_retpoline(func)) func->retpoline_thunk = true; - if (!strcmp(func->name, "__fentry__")) + if (arch_ftrace_match(func->name)) func->fentry = true; if (is_profiling_func(func->name)) diff --git a/tools/objtool/include/objtool/arch.h b/tools/objtool/include/objtool/arch.h index 9b19cc304195..99d0c8ba1b69 100644 --- a/tools/objtool/include/objtool/arch.h +++ b/tools/objtool/include/objtool/arch.h @@ -69,6 +69,8 @@ struct stack_op { struct instruction; +bool arch_ftrace_match(char *name); + void arch_initial_func_cfi_state(struct cfi_init_state *state); int arch_decode_instruction(struct objtool_file *file, const struct section *sec, -- 2.25.1