Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2523361rwi; Fri, 28 Oct 2022 08:04:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kz7CioRRMJutAqkFPAs8JfF2NzgUGeLraOq60a8HXycZz0NQ/gbYRmYEhhj92+E/0miiJ X-Received: by 2002:a17:902:bd05:b0:179:bbad:acff with SMTP id p5-20020a170902bd0500b00179bbadacffmr54277322pls.170.1666969450455; Fri, 28 Oct 2022 08:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666969450; cv=none; d=google.com; s=arc-20160816; b=m8ieDn9jpG51506p+2jvp0+QhMJBPy8z3oazqiv1lz5PgRw6P8n/kdpDkSLhDCzuxo bICUoqjE34rSM0g0NVPViBShTHaFy+RDxIA/Dt/1W5riyFdF5fE2CrOPMFHqtfwrInWa fz+HlUvY7Bzw1xRBgVNh6Xn6RkrDUInZaZMawajgkVATuz8wWf7JO9N9aiHUiYQmdyYE abpuIRSCWKrcYAyRxDBO5wMzedAgFxNLGaJ0PMDUY5xSMOkmB16mBO2gb5Z5QHIMUEcm IKC7sf0lLfbuHSHJFcZHftJKh3rAx5/o+dZLRt4WbtgVtbMy4zr2AHqH8wrcD4NnJuK8 Tk/w== 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=nDWq7QQBOjmjtNDRoBo0bB4ENp6TlGvH17dZAulBXEs=; b=dHy40LHN+U8aJX05F1GRhOrPcQxmM3t5107t0J+7wHFlqYkKgDz47gNKp0RiGqLAZV 7ky5jif7J8opqZb15kffcdpbiYaWl1EkwDkS3aNas9N6P5MJrYwuxYPK8uBpMgK9WQ5o IDyU5CXGVN9jaWWMAHwb6HoyuxFR7LA3lRV62Ttye+UX8sCwt4UofuwzTxb9AcxlME3l iFYUIOQmOMXrQjJGEnsd6fXoZ5Cs7uFEhFqYh9N1peUKMrfIOkqMEg7nfqYE63fpB08e 7yKaR4k7Kx71NMuJNHhXAB80fh8pOAdHs7I+2rTp2ljbsfBsP02kTyM8gvof9h48zxU8 Jhvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=O6RNuug3; 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 g15-20020a056a000b8f00b00563ad44ddf9si6136091pfj.380.2022.10.28.08.03.55; Fri, 28 Oct 2022 08:04:10 -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=O6RNuug3; 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 S229981AbiJ1Ogc (ORCPT + 99 others); Fri, 28 Oct 2022 10:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbiJ1OgD (ORCPT ); Fri, 28 Oct 2022 10:36:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 769A01A652C for ; Fri, 28 Oct 2022 07:35:41 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29SEXave028867; Fri, 28 Oct 2022 14:35:26 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=nDWq7QQBOjmjtNDRoBo0bB4ENp6TlGvH17dZAulBXEs=; b=O6RNuug3U18UddF5ILD+TQ5eGHM1oWAOw+3o9xJWOfkuwHE4JDmySAvtVUs95tF5y6Re kY44vmqnln8SwCKEPVA5vPtmWZe6aChnFjDQF5QmrWF5Nk6es+H9UsG+PNC6iyNHR4iR 4lN6oXUFnJGMGCyWzhTMqjF71qubRau+MFewuHPA9CbpK557ParjdG/IxYtCcd6WfyDm ZpEAI7888nRzlec0J+b4IHxxOhGg4RZTbYD2BJNapNXA5dNBHSxGs4p21AIUDvcpSnI7 ZpExcKAFUWHP0TkP6sUjTrXOE8G1eNNj3RmJj6EiUZirBK+pesoSgn9m22DNj0WYw6AJ BQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kgfhnu8f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:35:26 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29SEBprc004822; Fri, 28 Oct 2022 14:35:25 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3kgfhnu8bd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:35:25 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29SEKj2e019352; Fri, 28 Oct 2022 14:35:23 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 3kfahmjqg0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:35:22 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29SEU1GR45679070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2022 14:30:01 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 83AC6A4040; Fri, 28 Oct 2022 14:35:20 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24CD3A404D; Fri, 28 Oct 2022 14:35:16 +0000 (GMT) Received: from li-c3569c4c-1ef8-11b2-a85c-ee139cda3133.ibm.com.com (unknown [9.43.124.163]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 28 Oct 2022 14:35:15 +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, mingo@redhat.com, christophe.leroy@csgroup.eu, rostedt@goodmis.org, mbenes@suse.cz, npiggin@gmail.com, chenzhongjin@huawei.com, naveen.n.rao@linux.vnet.ibm.com, sv@linux.ibm.com Subject: [PATCH v5 14/16] objtool: Add arch specific function arch_ftrace_match() Date: Fri, 28 Oct 2022 20:03:44 +0530 Message-Id: <20221028143346.183569-15-sv@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221028143346.183569-1-sv@linux.ibm.com> References: <20221028143346.183569-1-sv@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: OsP0QYMPOHDEYOQk1x_o7X6plWKyUhzP X-Proofpoint-ORIG-GUID: LZPfi1tO8ZWsmddfLIShKzPThJ4Kc3jr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-28_07,2022-10-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 impostorscore=0 bulkscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2210280090 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 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 architecture specific symbols. Suggested-by: Christophe Leroy Tested-by: Naveen N. Rao Reviewed-by: Naveen N. Rao Reviewed-by: Christophe Leroy Acked-by: Josh Poimboeuf Signed-off-by: Sathvika Vasireddy --- tools/objtool/arch/x86/decode.c | 5 +++++ tools/objtool/check.c | 2 +- tools/objtool/include/objtool/arch.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 1c253b4b7ce0..af7ad09c926c 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -23,6 +23,11 @@ #include #include +int arch_ftrace_match(char *name) +{ + return !strcmp(name, "__fentry__"); +} + 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 2d7153b5d5d1..7580c66ca5c8 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2316,7 +2316,7 @@ static int classify_symbols(struct objtool_file *file) if (arch_is_rethunk(func)) func->return_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 beb2f3aa94ff..5149330f400f 100644 --- a/tools/objtool/include/objtool/arch.h +++ b/tools/objtool/include/objtool/arch.h @@ -69,6 +69,8 @@ struct stack_op { struct instruction; +int 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.31.1