public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux•org.uk>
To: Josh Poimboeuf <jpoimboe@kernel•org>
Cc: juri.lelli@redhat•com, dalias@libc•org,
	linux-ia64@vger•kernel.org, linux-sh@vger•kernel.org,
	peterz@infradead•org, catalin.marinas@arm•com,
	dave.hansen@linux•intel.com, x86@kernel•org,
	jiaxun.yang@flygoat•com, linux-mips@vger•kernel.org,
	bsegall@google•com, jcmvbkbc@gmail•com, guoren@kernel•org,
	hpa@zytor•com, sparclinux@vger•kernel.org, kernel@xen0n•name,
	will@kernel•org, vschneid@redhat•com, f.fainelli@gmail•com,
	vincent.guittot@linaro•org, ysato@users•sourceforge.jp,
	chenhuacai@kernel•org, linux-csky@vger•kernel.org,
	mingo@redhat•com, bcm-kernel-feedback-list@broadcom•com,
	mgorman@suse•de, mattst88@gmail•com,
	linux-xtensa@linux-xtensa•org, paulmck@kernel•org,
	richard.henderson@linaro•org, npiggin@gmail•com,
	ink@jurassic•park.msu.ru, rostedt@goodmis•org,
	loongarch@lists•linux.dev, tglx@linutronix•de,
	dietmar.eggemann@arm•com, linux-arm-kernel@lists•infradead.org,
	jgross@suse•com, chris@zankel•net, tsbogend@alpha•franken.de,
	bristot@redhat•com, linux-kernel@vger•kernel.org,
	lin ux-alpha@vger•kernel.org, bp@alien8•de,
	linuxppc-dev@lists•ozlabs.org, davem@davemloft•net
Subject: Re: [PATCH v2 03/24] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return
Date: Tue, 14 Feb 2023 22:01:29 +0000	[thread overview]
Message-ID: <Y+wEubLjgDQDIbSO@shell.armlinux.org.uk> (raw)
In-Reply-To: <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!

  reply	other threads:[~2023-02-14 22:03 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  7:05 [PATCH v2 00/24] cpu,sched: Mark arch_cpu_idle_dead() __noreturn Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 01/24] alpha/cpu: Expose arch_cpu_idle_dead()'s prototype declaration Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 02/24] alpha/cpu: Make sure arch_cpu_idle_dead() doesn't return Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 03/24] arm/cpu: " Josh Poimboeuf
2023-02-14 11:15   ` Russell King (Oracle)
2023-02-14 18:39     ` Josh Poimboeuf
2023-02-14 22:01       ` Russell King (Oracle) [this message]
2023-02-16 18:38         ` [PATCH v2.1 03/24] arm/cpu: Add unreachable() to arch_cpu_idle_dead() Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 04/24] arm64/cpu: Mark cpu_die() __noreturn Josh Poimboeuf
2023-02-14  8:13   ` Philippe Mathieu-Daudé
2023-02-15 13:09     ` Mark Rutland
2023-02-15 19:45       ` Josh Poimboeuf
2023-02-16 18:41         ` [PATCH v2.1 " Josh Poimboeuf
2023-03-02 10:55           ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 05/24] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 06/24] ia64/cpu: Mark play_dead() __noreturn Josh Poimboeuf
2023-02-14  8:07   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 07/24] loongarch/cpu: Make sure play_dead() doesn't return Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 08/24] loongarch/cpu: Mark play_dead() __noreturn Josh Poimboeuf
2023-02-14  8:06   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 09/24] mips/cpu: Expose play_dead()'s prototype definition Josh Poimboeuf
2023-02-14  7:46   ` Philippe Mathieu-Daudé
2023-02-14 18:11     ` Josh Poimboeuf
2023-02-15  8:29       ` Philippe Mathieu-Daudé
2023-02-16 18:42         ` [PATCH v2.1 " Josh Poimboeuf
2023-03-01 18:16           ` Josh Poimboeuf
2023-03-02 10:54             ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 10/24] mips/cpu: Make sure play_dead() doesn't return Josh Poimboeuf
2023-02-14  7:50   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 11/24] mips/cpu: Mark play_dead() __noreturn Josh Poimboeuf
2023-02-14  7:50   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 12/24] powerpc/cpu: Mark start_secondary_resume() __noreturn Josh Poimboeuf
2023-02-14  7:19   ` Christophe Leroy
2023-02-14  7:05 ` [PATCH v2 13/24] sh/cpu: Make sure play_dead() doesn't return Josh Poimboeuf
2023-02-14  7:57   ` Philippe Mathieu-Daudé
2023-02-14 18:28     ` Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 14/24] sh/cpu: Mark play_dead() __noreturn Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 15/24] sh/cpu: Expose arch_cpu_idle_dead()'s prototype definition Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 16/24] sparc/cpu: Mark cpu_play_dead() __noreturn Josh Poimboeuf
2023-02-14  7:52   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 17/24] x86/cpu: Make sure play_dead() doesn't return Josh Poimboeuf
2023-02-14  8:05   ` Philippe Mathieu-Daudé
2023-02-14  7:05 ` [PATCH v2 18/24] x86/cpu: Mark play_dead() __noreturn Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 19/24] xtensa/cpu: Make sure cpu_die() doesn't return Josh Poimboeuf
2023-02-14  7:55   ` Philippe Mathieu-Daudé
2023-02-14 18:23     ` Josh Poimboeuf
2023-02-14 19:29       ` Steven Rostedt
2023-02-14 19:48       ` Max Filippov
2023-02-14 20:19         ` Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 20/24] xtensa/cpu: Mark cpu_die() __noreturn Josh Poimboeuf
2023-02-14 12:47   ` Max Filippov
2023-02-14  7:05 ` [PATCH v2 21/24] sched/idle: Make sure weak version of arch_cpu_idle_dead() doesn't return Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 22/24] objtool: Include weak functions in 'global_noreturns' check Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 23/24] init: Make arch_call_rest_init() and rest_init() __noreturn Josh Poimboeuf
2023-02-14  7:05 ` [PATCH v2 24/24] sched/idle: Mark arch_cpu_idle_dead() __noreturn Josh Poimboeuf
2023-02-14  9:25 ` [PATCH v2 00/24] cpu,sched: " Philippe Mathieu-Daudé
2023-02-14 18:29   ` Josh Poimboeuf
2023-02-15 22:22 ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+wEubLjgDQDIbSO@shell.armlinux.org.uk \
    --to=linux@armlinux$(echo .)org.uk \
    --cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
    --cc=bristot@redhat$(echo .)com \
    --cc=bsegall@google$(echo .)com \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=chenhuacai@kernel$(echo .)org \
    --cc=chris@zankel$(echo .)net \
    --cc=dalias@libc$(echo .)org \
    --cc=dave.hansen@linux$(echo .)intel.com \
    --cc=dietmar.eggemann@arm$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=guoren@kernel$(echo .)org \
    --cc=hpa@zytor$(echo .)com \
    --cc=ink@jurassic$(echo .)park.msu.ru \
    --cc=jcmvbkbc@gmail$(echo .)com \
    --cc=jgross@suse$(echo .)com \
    --cc=jiaxun.yang@flygoat$(echo .)com \
    --cc=jpoimboe@kernel$(echo .)org \
    --cc=juri.lelli@redhat$(echo .)com \
    --cc=kernel@xen0n$(echo .)name \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-csky@vger$(echo .)kernel.org \
    --cc=linux-ia64@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mips@vger$(echo .)kernel.org \
    --cc=linux-sh@vger$(echo .)kernel.org \
    --cc=linux-xtensa@linux-xtensa$(echo .)org \
    --cc=loongarch@lists$(echo .)linux.dev \
    --cc=mattst88@gmail$(echo .)com \
    --cc=mgorman@suse$(echo .)de \
    --cc=mingo@redhat$(echo .)com \
    --cc=npiggin@gmail$(echo .)com \
    --cc=paulmck@kernel$(echo .)org \
    --cc=peterz@infradead$(echo .)org \
    --cc=richard.henderson@linaro$(echo .)org \
    --cc=rostedt@goodmis$(echo .)org \
    --cc=sparclinux@vger$(echo .)kernel.org \
    --cc=tglx@linutronix$(echo .)de \
    --cc=tsbogend@alpha$(echo .)franken.de \
    --cc=vincent.guittot@linaro$(echo .)org \
    --cc=vschneid@redhat$(echo .)com \
    --cc=will@kernel$(echo .)org \
    --cc=x86@kernel$(echo .)org \
    --cc=ysato@users$(echo .)sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox