Re: [PATCH v2 03/24] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
- Subject: Re: [PATCH v2 03/24] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return
- From: "Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx>
- Date: Tue, 14 Feb 2023 22:01:29 +0000
- Cc: linux-kernel@xxxxxxxxxxxxxxx, jgross@xxxxxxxx, richard.henderson@xxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, mattst88@xxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, catalin.marinas@xxxxxxx, will@xxxxxxxxxx, guoren@xxxxxxxxxx, linux-csky@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, chenhuacai@xxxxxxxxxx, kernel@xxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, f.fainelli@xxxxxxxxx, bcm-kernel-feedback-list@xxxxxxxxxxxx, tsbogend@xxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, jiaxun.yang@xxxxxxxxxxx, mpe@xxxxxxxxxxxxxx, npiggin@xxxxxxxxx, christophe.leroy@xxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, ysato@xxxxxxxxxxxxx, dalias@xxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, chris@xxxxxxxxxx, jcmvbkbc@xxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, juri.lelli@xxxxxxxxxx, vincent.guittot@xxxxxxxxxx, dietmar.eggemann@xxxxxxx, rostedt@xxxxxxxxxxx, bsegall@xxxxxxxxxx, mgorman@xxxxxxx, bristot@xxxxxxxxxx, vschneid@xxxxxxxxxx, paulmck@xxxxxxxxxx
- In-reply-to: <20230214183926.46trlpdror3v5sk5@treble>
- References: <cover.1676358308.git.jpoimboe@kernel.org> <ed361403b8ee965f758fe491c47336dddcfb8fd5.1676358308.git.jpoimboe@kernel.org> <Y+ttS0japRCzHoFM@shell.armlinux.org.uk> <20230214183926.46trlpdror3v5sk5@treble>
On Tue, Feb 14, 2023 at 10:39:26AM -0800, Josh Poimboeuf wrote:
> On Tue, Feb 14, 2023 at 11:15:23AM +0000, Russell King (Oracle) wrote:
> > On Mon, Feb 13, 2023 at 11:05:37PM -0800, Josh Poimboeuf wrote:
> > > arch_cpu_idle_dead() doesn't return. Make that more explicit with a
> > > BUG().
> > >
> > > BUG() is preferable to unreachable() because BUG() is a more explicit
> > > failure mode and avoids undefined behavior like falling off the edge of
> > > the function into whatever code happens to be next.
> >
> > This is silly. Just mark the function __noreturn and be done with it.
> > If the CPU ever executes code past the "b" instruction, it's already
> > really broken that the extra instructions that BUG() gives will be
> > meaningless.
> >
> > This patch does nothing except add yet more bloat the kernel.
> >
> > Sorry, but NAK.
>
> Problem is, the compiler can't read inline asm. So you'd get a
> "'noreturn' function does return" warning.
>
> We can do an unreachable() instead of a BUG() here if you prefer
> undefined behavior.
That's fine.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]