[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220630155811.GK25951@gate.crashing.org>
Date: Thu, 30 Jun 2022 10:58:11 -0500
From: Segher Boessenkool <segher@...nel.crashing.org>
To: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
Sathvika Vasireddy <sv@...ux.ibm.com>,
Sathvika Vasireddy <sv@...ux.vnet.ibm.com>,
Marc Zyngier <maz@...nel.org>, "aik@...abs.ru" <aik@...abs.ru>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"paulus@...ba.org" <paulus@...ba.org>,
"jpoimboe@...hat.com" <jpoimboe@...hat.com>,
"mbenes@...e.cz" <mbenes@...e.cz>,
Chen Zhongjin <chenzhongjin@...wei.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [RFC PATCH v3 11/12] powerpc: Remove unreachable() from WARN_ON()
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 <https://gcc.gnu.org/PR99299> that asks for a __builtin_trap()
variant that does not terminate control flow ("that is recoverable").
Segher
Powered by blists - more mailing lists