Message ID | 20221028143346.183569-2-sv@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp870107wru; Fri, 28 Oct 2022 07:42:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4p7BXErQx8jELprqV6Vly2O3K3FTS4fnJLiIA1SVVnY06kTxDMVNOdZQ7LQOC/wD8GMO8R X-Received: by 2002:a17:907:75c6:b0:79c:d3f4:4a14 with SMTP id jl6-20020a17090775c600b0079cd3f44a14mr34236214ejc.61.1666968161777; Fri, 28 Oct 2022 07:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666968161; cv=none; d=google.com; s=arc-20160816; b=Rok4m8mXAxdb/wdvWncW33SsgXLZfKwTZJXkmAIml8DlKNAIbSJxcFpnsdGMHYq2L+ /t1stTvC5EcrC47z4bC37oZ60bZGvmSdHYsB1AdLjvorkvYFcehQUZiTbtun/9CQMwvK 1dwBTqZ16QoGpIUAT30Ob+YeGr/AI+FNTUZToBuY3SYV3pQvOAqjyXkAhrD5sUdgsov/ Bt+oWqL5aoRDWBZtLqShLZbH178olgVig9D/zcJ+oBB+7mXQLkXWmhQ9fYcb9P6Qyh1H yQSk5FOWZlUgOn8HGvQ5uU3USHJYHvAQM248Rfq5W38chRIxVuBuiOo5jiUPxmwSkzgX ZW4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gMfFNvsrdFXtawn8XRHQRW/OhAVAeacUEVexkBFje9I=; b=ziEDMs0O6R40ylCFmBnkw4gq64aiHZ3mYRARQj4MuHUVNcAq8SKrCtdWvUgLvENSUP 5PmUb4tVYs5gjQJgR85jxt54h25nmc2+YHR3L2edQFmvlbzGZys5amzWenccFRT+5HIc Fh2o9mZQgwglFTv74vDbKbrXFwAoplEWTEuKNJ1pMif2VDh3J5CPaGNEuv9Nhg5B5ZP/ KxYcSwpPv8WWLON8tPgA7Y9Zjce5zUwdihM0yKiLpTV17XIvjExgC2riINlkZaJdyQm2 GRg86hD0E4jxo0pf8zyYXrbUCV4GdWjQlGW4x5WS/ljqt6j8lKYwi/LrGCHIgDNg52pr loww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kM9vGOrr; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw9-20020a170907a0c900b00787e1d77943si864173ejc.49.2022.10.28.07.42.17; Fri, 28 Oct 2022 07:42:41 -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=kM9vGOrr; 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 S230364AbiJ1Oeo (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Fri, 28 Oct 2022 10:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbiJ1Oel (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 28 Oct 2022 10:34:41 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA8FBFFA for <linux-kernel@vger.kernel.org>; Fri, 28 Oct 2022 07:34:39 -0700 (PDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29SEB81L026510; Fri, 28 Oct 2022 14:34:16 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 : content-transfer-encoding : mime-version; s=pp1; bh=gMfFNvsrdFXtawn8XRHQRW/OhAVAeacUEVexkBFje9I=; b=kM9vGOrrq115P3YzXCzQo7P2X3EowvH/HDVJTZI8Qt9uxeteDU3wli1VXFneAflYeTQ6 lUYz+vGczaddpbAXMCHfjCuwr1dxnaeM0fXqumLaCAoX5hp5ujl7XGB2w6kWjRTJKs2t Gd79NWX5cUEv0+s2prl8gG7XZ3R5+WQ03FytddMDmUtSY1fh598qzkSKPaH7AvoyNGZG 6luTgXq0/kh7aJl7LJkigG1SG7yUIPTqnXTPYO25F2IEygtpoQJnv7p501BpQPO4o1zF ND9bONzYZKnXNOUHugngUopSJORJCshPcV7J5a5lHwAGifiyleFdtW0p5rQqinY5gdrc ZQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kggm70w2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:16 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29SEBpH9031237; Fri, 28 Oct 2022 14:34:15 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kggm70w0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:15 +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 29SEKdPA019344; Fri, 28 Oct 2022 14:34:13 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 3kfahmjqef-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Oct 2022 14:34:13 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29SEYBM163766832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Oct 2022 14:34:11 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65F92A4040; Fri, 28 Oct 2022 14:34:11 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABD61A4053; Fri, 28 Oct 2022 14:34:06 +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:34:06 +0000 (GMT) From: Sathvika Vasireddy <sv@linux.ibm.com> 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 01/16] powerpc: Fix __WARN_FLAGS() for use with Objtool Date: Fri, 28 Oct 2022 20:03:31 +0530 Message-Id: <20221028143346.183569-2-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> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: -WThpeUm0tluSo4aTaJzGrera9egP_T0 X-Proofpoint-GUID: k7s8MRPtTeZWezhoqmktAHYynXTslbZW Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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=885 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747942806785543512?= X-GMAIL-MSGID: =?utf-8?q?1747942806785543512?= |
Series |
objtool: Enable and implement --mcount option on powerpc
|
|
Commit Message
Sathvika Vasireddy
Oct. 28, 2022, 2:33 p.m. UTC
Commit 1e688dd2a3d675 ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto") updated __WARN_FLAGS() to use asm goto, and added a call to 'unreachable()' after the asm goto for optimal code generation. With CONFIG_OBJTOOL enabled, 'annotate_unreachable()' statement in 'unreachable()' tries to note down the location of the subsequent instruction in a separate elf section to aid code flow analysis. However, on powerpc, this results in gcc emitting a call to a symbol of size 0. This results in objtool complaining of "unannotated intra-function call" since the target symbol is not a valid function call destination. Objtool wants this annotation for code flow analysis, which we are not yet enabling on powerpc. As such, expand the call to 'unreachable()' in __WARN_FLAGS() without annotate_unreachable(): barrier_before_unreachable(); __builtin_unreachable(); This still results in optimal code generation for __WARN_FLAGS(), while getting rid of the objtool warning. We still need barrier_before_unreachable() to work around gcc bugs 82365 and 106751: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365 - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106751 Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com> --- arch/powerpc/include/asm/bug.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h index 61a4736355c2..ef42adb44aa3 100644 --- a/arch/powerpc/include/asm/bug.h +++ b/arch/powerpc/include/asm/bug.h @@ -99,7 +99,8 @@ __label__ __label_warn_on; \ \ WARN_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags), __label_warn_on); \ - unreachable(); \ + barrier_before_unreachable(); \ + __builtin_unreachable(); \ \ __label_warn_on: \ break; \