Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp49857imw; Mon, 4 Jul 2022 05:08:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDrbOYedd+NjG0OvjA0/sOEu1Sj+y07gAf3INPH0sgr97hzzLzDygWC7ghJOQzEHGQOXVV X-Received: by 2002:a17:907:6ea8:b0:726:a8bb:5a3e with SMTP id sh40-20020a1709076ea800b00726a8bb5a3emr28440677ejc.753.1656936526304; Mon, 04 Jul 2022 05:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656936526; cv=none; d=google.com; s=arc-20160816; b=M3/yK6qRYyFP1/PuKi8Q/u/9LJHebRTj3Y/TluGgi9s7DqC4aQrqpvoFSnyjPQy6yY fvmKTMfN6xHAbs0wnXnAT6kyyNJ/YJlXCYoYGJUsRjTMKzGySqksbbt4gnByaTkSx1T0 VtVJ78BHLKam47tytF3D95VRd0uYHymYWNXuZ8Y9cLbzhQydqhj9QPFiKg7vAbZ5ePdQ m8+MKr4qLKA5Txz7NueiI/y7lNw+ITrZvQDHaot5svSN4oZx17nrOG2uSZxwrgow8UO4 JiP3z5QqP+rlmUSprYdifbClynJBbS510xJPe9R+KbalGkJV1DVTUJoPuyQ8FgwkjvJm Lhew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kIdu/42GiilHlXUS78N+LpZH4GE+kn27IfgICi3avuI=; b=0AOOfQj319gd1AVVIxoWcvpMkX993jIoEYf0/RxKNDu/TbgAp9S9UU5cC4PifixxNY vGm/1l5YNGbdciZ68/bw6fq2EScY/L88VzxwX/IocQmbg03SKN77F9gGtTOLvzQYw1MK +Wo/nkT2Kw6g2iYSWkn8YNzWooYYE5GSQoJmf011odmQmB7zYnVgd3YzzmSK9R+2OVmD Ujd81psu57D0FH9KBibRXskbyAxfknow/b+TtNiWfWLLJB0SRnX+zsL1ynL9qHHEkUZR Jnz1blzkPzF3x+73dISHKDvKzxwxWs9K2H+AYuuciOixwWuxSa2kQyVZLmwQ3u68vm7W HuvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JLISIeys; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht15-20020a170907608f00b0072ac9846988si3442301ejc.478.2022.07.04.05.08.20; Mon, 04 Jul 2022 05:08:46 -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=@infradead.org header.s=casper.20170209 header.b=JLISIeys; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233441AbiGDMF5 (ORCPT + 99 others); Mon, 4 Jul 2022 08:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233282AbiGDMF4 (ORCPT ); Mon, 4 Jul 2022 08:05:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688B0F580 for ; Mon, 4 Jul 2022 05:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=kIdu/42GiilHlXUS78N+LpZH4GE+kn27IfgICi3avuI=; b=JLISIeyssHb/kRbwBuaUKrdqYH G5DdMBv/BqSqZncpjaTbVoX38L7oDa11sj4yAPxb2R3yr+njxADtoXOt4Uan/9yV4pliVrM0ngTtf ojxNY8UJjAf+GKRq949ZvqIGE/kNuoXvZyub3BIGErUkR23tQVqyMOq9eVmcrp0qzQVQEtdRgy5Dk 8Gvx/WEn2J5yzDXRFUiBj7E8XV2COecDNWybtI9RILDTkFitzC2Mljhth9BvwA4/brUyCf514b1W3 0gmGaxFLtfix0Uia0G6HszjE0wODeG9AdiaRW6ymEKK8OXE6CQtEMEbLFyAqFqAIk9ZRp4oxkzpJX wZRtXUoQ==; Received: from dhcp-077-249-017-003.chello.nl ([77.249.17.3] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8Kpd-00HEp3-3O; Mon, 04 Jul 2022 12:05:37 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9C83830033D; Mon, 4 Jul 2022 14:05:36 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 85D292028F029; Mon, 4 Jul 2022 14:05:36 +0200 (CEST) Date: Mon, 4 Jul 2022 14:05:36 +0200 From: Peter Zijlstra To: Christophe Leroy Cc: Sathvika Vasireddy , "linuxppc-dev@lists.ozlabs.org" , "jpoimboe@redhat.com" , "linux-kernel@vger.kernel.org" , "aik@ozlabs.ru" , "mpe@ellerman.id.au" , "mingo@redhat.com" , "rostedt@goodmis.org" , "naveen.n.rao@linux.vnet.ibm.com" , "mbenes@suse.cz" , "benh@kernel.crashing.org" , "paulus@samba.org" Subject: Re: [RFC PATCH v3 11/12] powerpc: Remove unreachable() from WARN_ON() Message-ID: References: <20220624183238.388144-1-sv@linux.ibm.com> <20220624183238.388144-12-sv@linux.ibm.com> <70b6d08d-aced-7f4e-b958-a3c7ae1a9319@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <70b6d08d-aced-7f4e-b958-a3c7ae1a9319@csgroup.eu> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Sat, Jun 25, 2022 at 06:46:54AM +0000, Christophe Leroy wrote: > > > Le 24/06/2022 ? 20:32, Sathvika Vasireddy a ?crit?: > > objtool is throwing *unannotated intra-function call* > > warnings with a few instructions that are marked > > unreachable. Remove unreachable() from WARN_ON() > > to fix these warnings, as the codegen remains same > > with and without unreachable() in WARN_ON(). > > Did you try the two exemples described in commit 1e688dd2a3d6 > ("powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with > asm goto") ? > > Without your patch: > > 00000640 : > 640: 81 23 00 84 lwz r9,132(r3) > 644: 71 29 40 00 andi. r9,r9,16384 > 648: 40 82 00 0c bne 654 > 64c: 80 63 00 0c lwz r3,12(r3) > 650: 4e 80 00 20 blr > 654: 0f e0 00 00 twui r0,0 > > 00000658 : > 658: 2c 04 00 00 cmpwi r4,0 > 65c: 41 82 00 0c beq 668 > 660: 7c 63 23 96 divwu r3,r3,r4 > 664: 4e 80 00 20 blr > 668: 0f e0 00 00 twui r0,0 > 66c: 38 60 00 00 li r3,0 > 670: 4e 80 00 20 blr Per this construct you should do as x86 does and assume twui terminates control flow and explicitly annotate the WARN case. That is, given the fact that BUG as no instructions following it, you can't very well annotate that. Alternatively, you can teach objtool to look at __bug_table to distinguish these cases.