Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1587697rwb; Sun, 2 Oct 2022 04:16:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kvmVcPwFT3nKNp4bVct2sqKtXQZvo9D9WgJYS68LMGM6xaTQPJ7dQTP+9iD6NZKVl9aeU X-Received: by 2002:a17:906:b08d:b0:782:d526:3e36 with SMTP id x13-20020a170906b08d00b00782d5263e36mr12045621ejy.358.1664709382669; Sun, 02 Oct 2022 04:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664709382; cv=none; d=google.com; s=arc-20160816; b=yqru0NbjSud4VXmCHV4aDxSrmrOLfabkRQJx6XgrEzqzMM4euPdZaiyxpKEdaJl+pJ U1M5PYy9sCAGAwLHS3OVKN3gNt9qI72KAQ4Evg3VIsX2zVVlOSR3JjrpyAwkbWZgJRmO yE7v+nYEkWptprK2+GCv7hjKy8VXhWsMZWkMo1Hpl4rxnGKPMKXks/jR+vzxJ6/U2GzR Zf+9Ff2Z0LVNChvJcH+a8QP64hw4lZ8NAaTQpGURqSFnQE9AsHd1blolDXKNSrg58SUv f7atE/7Z8FvB1q+wKb/KoYpRjHHj7c5FDGOq/Hd3EBLvekKH5lsA9pkbnOOZnq68fbYV XIWA== 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=pIVSStzXkzMCQKu51+bqeIkE7v1EnMDNXkIa6OMrcAo=; b=fA/PNRD/SI3yZPy48c3yY6y2Rr5pGFkKhmn7hgc/hiVO6DWXB02vq5DYG63UMgKUie EEG0gcUq6CTShs39z66hz4h5Dj8fj84P4uRIY0v/u5G7Nr5W2ewgTLdMwr+if7sNSz9E lOBz6UgdGngTQLvWzskvKXTn8Lwg6UrF9deijhk2O7gLcQpDeHNiSbQldVOeTkVuDQQg A0FOzWHQHurgifTGLviU8PHkUL2Pibb0OgO/CS53CcLZLrsJs17IUHRdoa5bt183iv/y LL55b0tvYzU4XPX0LWm+lwg0k/Jez2aczJdadWlZCComZ7zmNqAXH/Q+ohNWQYMerbMt 2Fqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Mh7NkoBo; 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 bf26-20020a0564021a5a00b00458e6acdcf5si1118548edb.384.2022.10.02.04.15.56; Sun, 02 Oct 2022 04:16:22 -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=Mh7NkoBo; 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 S229705AbiJBKoF (ORCPT + 99 others); Sun, 2 Oct 2022 06:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiJBKoD (ORCPT ); Sun, 2 Oct 2022 06:44:03 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B89251260F for ; Sun, 2 Oct 2022 03:44:02 -0700 (PDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2929ugU0017177; Sun, 2 Oct 2022 10:43:38 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=pIVSStzXkzMCQKu51+bqeIkE7v1EnMDNXkIa6OMrcAo=; b=Mh7NkoBo3UWiEvfJAcPnJxKTxnpNjog9ibGxvXBqu3vbNkhQKThGAvmSCH9FN9ywdu6o e/ZdGidyke1jYeGX00/xB6dEVEsDREzq9IWE/OTbESu/5T9SibzCYlosUVl9/IHnQGl9 J0Odf23ri4VEW40Y0Onht6tHSaIF2I3rvT1HyxMuT5AUtSD6KsMOoBy6BUDclwTSWBCN 0lT+fwEgBSqV31Gors7xFhSsz+d6WEMRbjYK6okicliqGocsg4+xUZbMNL4lPVc1uLLA Yxz9bP/uFqCAhPPitbMEkk1UsvsKcCBpOhArhbitoWLkDM4lX5nSJnR/uiKp3z+/l7ao +Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jxxvb1j1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Oct 2022 10:43:38 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 292AhbTk023049; Sun, 2 Oct 2022 10:43:37 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jxxvb1j1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Oct 2022 10:43:37 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 292Aa9K6022918; Sun, 2 Oct 2022 10:43:35 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3jxd691aqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 02 Oct 2022 10:43:34 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 292AhWSZ7733788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 2 Oct 2022 10:43:32 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C469F5204F; Sun, 2 Oct 2022 10:43:32 +0000 (GMT) Received: from li-c3569c4c-1ef8-11b2-a85c-ee139cda3133.ibm.com.com (unknown [9.43.71.20]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C78485204E; Sun, 2 Oct 2022 10:43:28 +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 v4 01/16] powerpc: Fix __WARN_FLAGS() for use with Objtool Date: Sun, 2 Oct 2022 16:12:25 +0530 Message-Id: <20221002104240.1316480-2-sv@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221002104240.1316480-1-sv@linux.ibm.com> References: <20221002104240.1316480-1-sv@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: hZN7-n3UnIU5SopE-_Nwy8nIJ5oVBSSJ X-Proofpoint-ORIG-GUID: rFNe2r87kg1gQrg3tSZFRYC7UCEriNLl 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.528,FMLib:17.11.122.1 definitions=2022-10-01_15,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 mlxlogscore=911 adultscore=0 priorityscore=1501 malwarescore=0 phishscore=0 suspectscore=0 impostorscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210020068 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 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 Reviewed-by: Christophe Leroy Signed-off-by: Sathvika Vasireddy --- 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; \ -- 2.31.1