From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0132C433EF for ; Thu, 30 Jun 2022 16:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Mime-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+FL4bW4sOxNNl9g0XopWHRUcjOqDb/su6mQDerspSWY=; b=FpR9yFJG7p1CP1 GDHnbULufTOr0rrmz+cDhqIgrnL5OLg2rLBtWAXaQJMLMcTQJiOVE3/LkrKg6TiQF0UB1IH41Uk4g bJWalOthadKZEmwpJXl2j2oUgfV5QRoZbPyyoANBlLs5e5fwT8lfK/MyLenBOrJolldjxK+fllWFy sfdZHcOS3ofO6OybMKhZBiByhcyJIxMPgXUzsENy/lXFg9yAl8eUTNkWtOO4S8/h2bAFqXjtwSs6P TzhppEYT1jM7olOg9kLrI5HIygT+j5NNyrP/XS+vrnFYvZ8T+bBCfM6/RYKz7FNVDP/x0seSdlp8M S/AiNid4QgkUNiwpJlPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6wb1-000TBE-2L; Thu, 30 Jun 2022 16:00:47 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6wax-000TAX-Fn for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2022 16:00:45 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 25UFwEc4007186; Thu, 30 Jun 2022 10:58:14 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 25UFwBWR007180; Thu, 30 Jun 2022 10:58:11 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 30 Jun 2022 10:58:11 -0500 From: Segher Boessenkool To: "Naveen N. Rao" Cc: Christophe Leroy , "linuxppc-dev@lists.ozlabs.org" , Sathvika Vasireddy , Sathvika Vasireddy , Marc Zyngier , "aik@ozlabs.ru" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "peterz@infradead.org" , "mingo@redhat.com" , "paulus@samba.org" , "jpoimboe@redhat.com" , "mbenes@suse.cz" , Chen Zhongjin , Linux ARM Subject: Re: [RFC PATCH v3 11/12] powerpc: Remove unreachable() from WARN_ON() Message-ID: <20220630155811.GK25951@gate.crashing.org> References: <20220624183238.388144-1-sv@linux.ibm.com> <20220624183238.388144-12-sv@linux.ibm.com> <70b6d08d-aced-7f4e-b958-a3c7ae1a9319@csgroup.eu> <92eae2ef-f9b6-019a-5a8e-728cdd9bbbc0@linux.vnet.ibm.com> <1656572413.pbaqjnrrcl.naveen@linux.ibm.com> <1656583960.0nqsj977sr.naveen@linux.ibm.com> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <1656583960.0nqsj977sr.naveen@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220630_090043_803075_528BE9F7 X-CRM114-Status: GOOD ( 12.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 30, 2022 at 04:07:47PM +0530, Naveen N. Rao wrote: > Objtool classifies 'ud2' as INSN_BUG, and 'int3' as INSN_TRAP. In x86 > BUG(), there is no need for an annotation since objtool assumes that > 'ud2' terminates control flow. But, for __WARN_FLAGS(), since 'ud2' is > used, an explicit annotate_reachable() is needed. That's _reachable_, to > indicate that the control flow can continue with the next instruction. > > On powerpc, we should (eventually) classify all trap variants as > INSN_TRAP. Even in the absence of that classification today, objtool > assumes that control flow continues with the next instruction. With your > work to utilize asm goto for __WARN_FLAGS(), with no extra instructions > being generated, I think it is appropriate to just use > __builtin_unreachable() and to not use the annotation. > > In any case, we are only hitting this since gcc is generating a 'bl' due > to that annotation. We are not yet enabling full objtool validation on > powerpc, so I think we can revisit this at that point. See also that asks for a __builtin_trap() variant that does not terminate control flow ("that is recoverable"). Segher _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel