Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp748289iog; Thu, 30 Jun 2022 09:23:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t2rCrAvu10fGlZ6MVvCQE7x/Ru4v/FDD7BUR4rXR775FDZf6EGVsDkOmfU2zl5cWJlWlcf X-Received: by 2002:a17:906:31d9:b0:726:a68b:b666 with SMTP id f25-20020a17090631d900b00726a68bb666mr9701026ejf.159.1656606202984; Thu, 30 Jun 2022 09:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656606202; cv=none; d=google.com; s=arc-20160816; b=Gvw0qZ1lkeod9oaXava9vctbxj62vQ/nkuMp1RhUMnVofWfiV3uxMminvI/TDOIgR6 IT5kQR0Dg19sVo68JPj/GGaeMc8zXnJ8hRfN3I0/aJD7Ya4TzvqZ5NByeqwcTeHVOszN ZXQI6/6+rkTqVdmPFIHmIUkU2D0JKkBYAXlKl71fGHeW0jUGFmCqxIA1o4xS4RbK5H75 TWZ2mhwkllCKRqpE4SQpQ9eOLstxX1uS5+HCL6aJZIVzqMi4Df6xgiY0mLqovIdl2Kcy aqittB1KJtzL28TSB/JiHcEtIEHbeW75S47zLL8fea5+XhYo6suKBgTORLs/q1baPV4S Y9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3Of3cABjvCrZWsIPtFLJliPmsA7E+iTiC75AYwBa0G4=; b=sax6EndSeA7WIkbovk6kQWRJZ7W6wMSNd5dSo/MUWr880/zdSskDlCiumit/Nfy8oq MyA7C6MBUG+SM9ckc33cV0/61P7LjyXYMFdSajKoRRPwaVHR/FjLnJGnDOtUfNaeRV3w 81b+BCKpXPJEMesIDQSgt9J+b+OGdhqr1+h2dDTp2lLiH/8VAwhQrVis6Sg29xcCorYC +XnBv+z+gH5U2w55QoL0BeuBLDMBR2waMEBM4xo4AgyYnLfPOPMtHZATpp6Hyrc0qwDJ vPM7dSbyub0IDPWk29DjXLTVAmcAUH6JFg6Ygh1NbjQOcad9hr80+JI6CuwOtXEci0Ot 3/JA== ARC-Authentication-Results: i=1; mx.google.com; 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 i11-20020a05640242cb00b0043578c2decfsi6396736edc.444.2022.06.30.09.22.57; Thu, 30 Jun 2022 09:23: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; 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 S235802AbiF3QHb (ORCPT + 99 others); Thu, 30 Jun 2022 12:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235595AbiF3QHX (ORCPT ); Thu, 30 Jun 2022 12:07:23 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5A7D1AF0F for ; Thu, 30 Jun 2022 09:07:18 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1656583960.0nqsj977sr.naveen@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,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 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