Re: [PATCH 3/3] drm/amd/display: Support DRM_AMD_DC_FP on RISC-V

2023-12-12 Thread Josh Poimboeuf
On Mon, Dec 11, 2023 at 11:12:42PM -0800, Christoph Hellwig wrote: > On Thu, Dec 07, 2023 at 10:49:53PM -0600, Samuel Holland wrote: > > Actually tracking all possibly-FPU-tainted functions and their call sites is > > probably possible, but a much larger task. > > I think objtool should be able

Re: [PATCH] objtool: Make 'sec-address' always on

2023-06-25 Thread Josh Poimboeuf
On Sat, Jun 24, 2023 at 08:30:48AM +, Christophe Leroy wrote: > >>> vmlinux.o: warning: objtool: ibt_selftest+0x14 (.text+0x92b54): sibling > >>> call from callable instruction with modified stack frame > > vmlinux.o: warning: objtool: .altinstr_replacement+0x19a4: redundant > > UACCESS

Re: [PATCH] objtool: Make 'sec-address' always on

2023-06-22 Thread Josh Poimboeuf
On Wed, Jun 21, 2023 at 05:20:31PM +0200, Christophe Leroy wrote: > Most of the time objtool warnings are useless without the > absolute address within the section. > > Today there is --sec-address option to get it printed, but > that option is nowhere used and requires a change in Makefile > to

Re: [PATCH v2 0/2] start_kernel: omit stack canary

2023-04-18 Thread Josh Poimboeuf
a69b507...@google.com > (sorry for the spam with v2, mrincon is helping me get kinks worked out > with b4 and our corporate mailer) Acked-by: Josh Poimboeuf -- Josh

Re: [PATCH v2.1 09/24] mips/cpu: Expose play_dead()'s prototype definition

2023-03-01 Thread Josh Poimboeuf
On Thu, Feb 16, 2023 at 10:42:52AM -0800, Josh Poimboeuf wrote: > Include to make sure play_dead() matches its prototype going > forward. > > Acked-by: Florian Fainelli > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Josh Poimboeuf The latest version of this pat

Re: [PATCH] powerpc/64: Fix unannotated intra-function call warning

2023-02-16 Thread Josh Poimboeuf
n_book3s symbol with the > SYM_FUNC_START_LOCAL and SYM_FUNC_END macros. > > Reported-by: Stephen Rothwell > Signed-off-by: Sathvika Vasireddy Suggested-by: Josh Poimboeuf -- Josh

Re: linux-next: build warning after merge of the powerpc tree

2023-02-16 Thread Josh Poimboeuf
On Fri, Feb 17, 2023 at 12:35:17PM +1100, Michael Ellerman wrote: > Josh Poimboeuf writes: > > On Thu, Feb 16, 2023 at 02:40:31PM +1100, Stephen Rothwell wrote: > >> Hi all, > >> > >> After merging the powerpc tree, today's linux-next build (powerpc

[PATCH v2.1 09/24] mips/cpu: Expose play_dead()'s prototype definition

2023-02-16 Thread Josh Poimboeuf
Include to make sure play_dead() matches its prototype going forward. Acked-by: Florian Fainelli Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Josh Poimboeuf --- arch/mips/cavium-octeon/smp.c | 1 + arch/mips/kernel/smp-bmips.c | 1 + arch/mips/kernel/smp-cps.c| 1 + arch/mips

[PATCH v2.1 04/24] arm64/cpu: Mark cpu_die() __noreturn

2023-02-16 Thread Josh Poimboeuf
cpu_die() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Acked-by: Mark Rutland Signed-off-by: Josh Poimboeuf --- arch/arm64/include/asm/smp.h | 2 +- arch/arm64/kernel/smp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v2.1 03/24] arm/cpu: Add unreachable() to arch_cpu_idle_dead()

2023-02-16 Thread Josh Poimboeuf
arch_cpu_idle_dead() doesn't return. Make that visible to the compiler with an unreachable() code annotation. Signed-off-by: Josh Poimboeuf --- arch/arm/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 0b8c25763adc

Re: linux-next: build warning after merge of the powerpc tree

2023-02-16 Thread Josh Poimboeuf
On Thu, Feb 16, 2023 at 02:40:31PM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the powerpc tree, today's linux-next build (powerpc > pseries_le_defconfig) produced this warning: > > arch/powerpc/kernel/head_64.o: warning: objtool: .text+0x6128: unannotated > intra-function call >

Re: [PATCH v2 04/24] arm64/cpu: Mark cpu_die() __noreturn

2023-02-15 Thread Josh Poimboeuf
On Wed, Feb 15, 2023 at 01:09:21PM +, Mark Rutland wrote: > On Tue, Feb 14, 2023 at 09:13:08AM +0100, Philippe Mathieu-Daudé wrote: > > On 14/2/23 08:05, Josh Poimboeuf wrote: > > > cpu_die() doesn't return. Annotate it as such. By extension this also > > &g

Re: [PATCH v2 19/24] xtensa/cpu: Make sure cpu_die() doesn't return

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 11:48:41AM -0800, Max Filippov wrote: > On Tue, Feb 14, 2023 at 10:23 AM Josh Poimboeuf wrote: > > On Tue, Feb 14, 2023 at 08:55:32AM +0100, Philippe Mathieu-Daudé wrote: > > > Can you update the documentation along? Currently we have: > > > &

Re: [PATCH v2 03/24] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 11:15:23AM +, 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 unreachabl

Re: [PATCH v2 00/24] cpu,sched: Mark arch_cpu_idle_dead() __noreturn

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 10:25:50AM +0100, Philippe Mathieu-Daudé wrote: > On 14/2/23 08:05, Josh Poimboeuf wrote: > > v2: > > - make arch_call_rest_init() and rest_init() __noreturn > > - make objtool 'global_returns' work for weak functions > > - rebase on tip/obj

Re: [PATCH v2 13/24] sh/cpu: Make sure play_dead() doesn't return

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 08:57:39AM +0100, Philippe Mathieu-Daudé wrote: > On 14/2/23 08:05, Josh Poimboeuf wrote: > > play_dead() doesn't return. Make that more explicit with a BUG(). > > > > BUG() is preferable to unreachable() because BUG() is a more explicit > &

Re: [PATCH v2 19/24] xtensa/cpu: Make sure cpu_die() doesn't return

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 08:55:32AM +0100, Philippe Mathieu-Daudé wrote: > Hi Josh, > > On 14/2/23 08:05, Josh Poimboeuf wrote: > > cpu_die() doesn't return. Make that more explicit with a BUG(). > > > > BUG() is preferable to unreachable() because BUG() is a mor

Re: [PATCH v2 09/24] mips/cpu: Expose play_dead()'s prototype definition

2023-02-14 Thread Josh Poimboeuf
On Tue, Feb 14, 2023 at 08:46:41AM +0100, Philippe Mathieu-Daudé wrote: > Hi Josh, > > On 14/2/23 08:05, Josh Poimboeuf wrote: > > Include to make sure play_dead() matches its prototype going > > forward. > > > > Acked-by: Florian Fainelli > > Signed-off

[PATCH v2 24/24] sched/idle: Mark arch_cpu_idle_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
h-specific implementation might return. It also improves code generation for both caller and callee. Also fixes the following warning: vmlinux.o: warning: objtool: do_idle+0x25f: unreachable instruction Reported-by: Paul E. McKenney Tested-by: Paul E. McKenney Signed-off-by: Josh Poimboeuf

[PATCH v2 23/24] init: Make arch_call_rest_init() and rest_init() __noreturn

2023-02-13 Thread Josh Poimboeuf
arch_call_rest_init() and rest_init() don't return. Annotate them as such. Fixes the following warning: init/main.o: warning: objtool: start_kernel+0x4ad: unreachable instruction Signed-off-by: Josh Poimboeuf --- arch/s390/kernel/setup.c | 2 +- include/linux/start_kernel.h | 4

[PATCH v2 22/24] objtool: Include weak functions in 'global_noreturns' check

2023-02-13 Thread Josh Poimboeuf
If a global __noreturn function prototype has a corresponding weak function, it should also be __noreturn. Signed-off-by: Josh Poimboeuf --- tools/objtool/check.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index

[PATCH v2 21/24] sched/idle: Make sure weak version of arch_cpu_idle_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
arch_cpu_idle_dead() should never return. Make it so. Signed-off-by: Josh Poimboeuf --- kernel/sched/idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index e9ef66be2870..56e152f06d0f 100644 --- a/kernel/sched/idle.c +++ b

[PATCH v2 20/24] xtensa/cpu: Mark cpu_die() __noreturn

2023-02-13 Thread Josh Poimboeuf
cpu_die() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/xtensa/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/include/asm/smp.h b/arch/xtensa/include

[PATCH v2 19/24] xtensa/cpu: Make sure cpu_die() doesn't return

2023-02-13 Thread Josh Poimboeuf
cpu_die() 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. Signed-off-by: Josh Poimboeuf

[PATCH v2 18/24] x86/cpu: Mark play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/smp.h | 2 +- arch/x86/kernel/process.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include

[PATCH v2 17/24] x86/cpu: Make sure play_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
e function into whatever code happens to be next. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/smp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index b4dbb20dab1a..8f628e08b25a 100644 --- a/arch/x86/include/asm/smp.h +++

[PATCH v2 16/24] sparc/cpu: Mark cpu_play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
cpu_play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/sparc/include/asm/smp_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc

[PATCH v2 15/24] sh/cpu: Expose arch_cpu_idle_dead()'s prototype definition

2023-02-13 Thread Josh Poimboeuf
Include to make sure arch_cpu_idle_dead() matches its prototype going forward. Signed-off-by: Josh Poimboeuf --- arch/sh/kernel/idle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 3418c40f0099..114f0c4abeac 100644 --- a/arch/sh/kernel

[PATCH v2 14/24] sh/cpu: Mark play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/sh/include/asm/smp-ops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/asm/smp-ops.h b/arch/sh/include

[PATCH v2 13/24] sh/cpu: Make sure play_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
play_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. Signed-off-by: Josh Poimboeuf

[PATCH v2 12/24] powerpc/cpu: Mark start_secondary_resume() __noreturn

2023-02-13 Thread Josh Poimboeuf
start_secondary_resume() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Acked-by: Michael Ellerman (powerpc) Signed-off-by: Josh Poimboeuf --- arch/powerpc/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2 11/24] mips/cpu: Mark play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Acked-by: Florian Fainelli Signed-off-by: Josh Poimboeuf --- arch/mips/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm

[PATCH v2 10/24] mips/cpu: Make sure play_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
-off-by: Josh Poimboeuf --- arch/mips/kernel/smp-bmips.c | 2 ++ arch/mips/loongson64/smp.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index df9158e8329d..be85fa075830 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips

[PATCH v2 09/24] mips/cpu: Expose play_dead()'s prototype definition

2023-02-13 Thread Josh Poimboeuf
Include to make sure play_dead() matches its prototype going forward. Acked-by: Florian Fainelli Signed-off-by: Josh Poimboeuf --- arch/mips/kernel/smp-bmips.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index f5d7bfa3472a

[PATCH v2 08/24] loongarch/cpu: Mark play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/loongarch/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch

[PATCH v2 07/24] loongarch/cpu: Make sure play_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
play_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. Signed-off-by: Josh Poimboeuf

[PATCH v2 06/24] ia64/cpu: Mark play_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/ia64/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel

[PATCH v2 05/24] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
-off-by: Josh Poimboeuf --- arch/csky/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index b45d1073307f..0ec20efaf5fd 100644 --- a/arch/csky/kernel/smp.c +++ b/arch/csky/kernel/smp.c @@ -317,5 +317,7 @@ void arch_cpu_idle_dead(void

[PATCH v2 04/24] arm64/cpu: Mark cpu_die() __noreturn

2023-02-13 Thread Josh Poimboeuf
cpu_die() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/arm64/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm

[PATCH v2 03/24] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
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. Signed-off-by: Josh

[PATCH v2 01/24] alpha/cpu: Expose arch_cpu_idle_dead()'s prototype declaration

2023-02-13 Thread Josh Poimboeuf
Include to make sure arch_cpu_idle_dead() matches its prototype going forward. Signed-off-by: Josh Poimboeuf --- arch/alpha/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index ce20c31828a0..d1f2e8b6b107 100644

[PATCH v2 02/24] alpha/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-13 Thread Josh Poimboeuf
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. Signed-off-by: Josh

[PATCH v2 00/24] cpu,sched: Mark arch_cpu_idle_dead() __noreturn

2023-02-13 Thread Josh Poimboeuf
v2: - make arch_call_rest_init() and rest_init() __noreturn - make objtool 'global_returns' work for weak functions - rebase on tip/objtool/core with dependencies merged in (mingo) - add acks v1.1: - add __noreturn to all arch_cpu_idle_dead() implementations (mpe) Josh Poimboeuf (24): alpha

[PATCH v1.1 22/22] sched/idle: Mark arch_cpu_idle_dead() __noreturn

2023-02-07 Thread Josh Poimboeuf
h-specific implementation might return. It also improves code generation for both caller and callee. Also fixes the following warning: vmlinux.o: warning: objtool: do_idle+0x25f: unreachable instruction Reported-by: Paul E. McKenney Tested-by: Paul E. McKenney Signed-off-by: Josh Poimboeuf

Re: [PATCH 12/22] powerpc/cpu: Mark start_secondary_resume() __noreturn

2023-02-06 Thread Josh Poimboeuf
On Mon, Feb 06, 2023 at 10:10:22PM +1100, Michael Ellerman wrote: > Josh Poimboeuf writes: > > start_secondary_resume() doesn't return. Annotate it as such. By > > extension this also makes arch_cpu_idle_dead() noreturn. > > Can we also mark arch_cpu_idle_dead() (the C

Re: [PATCH 0/2] powerpc: Fix livepatch module re-patching issue

2023-02-05 Thread Josh Poimboeuf
On Sun, Feb 05, 2023 at 11:46:12AM +1100, Michael Ellerman wrote: > Josh Poimboeuf writes: > > On Tue, Jan 24, 2023 at 07:38:03PM -0800, Josh Poimboeuf wrote: > >> Fix a livepatch bug seen when reloading a patched module. > >> > >> This is the powerpc counter

Re: [PATCH 0/2] powerpc: Fix livepatch module re-patching issue

2023-02-04 Thread Josh Poimboeuf
On Tue, Jan 24, 2023 at 07:38:03PM -0800, Josh Poimboeuf wrote: > Fix a livepatch bug seen when reloading a patched module. > > This is the powerpc counterpart to Song Liu's fix for a similar issue on > x86: > > https://lkml.kernel.org/lkml/20230121004945.697003-2-s...@ke

Re: [PATCH v2 15/16] objtool/powerpc: Enable objtool to be built on ppc

2023-02-04 Thread Josh Poimboeuf
On Sat, Feb 04, 2023 at 02:10:34PM +0100, Christophe Leroy wrote: > Ok, got the same problem as you with next-20230203 > > DESCEND objtool > :1:10: fatal error: libelf.h: No such file or directory > compilation terminated. > HOSTCC /home/chleroy/linux-powerpc/tools/objtool/fixdep.o >

Re: [PATCH 05/22] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
On Sat, Feb 04, 2023 at 09:12:31AM +0800, Guo Ren wrote: > On Sat, Feb 4, 2023 at 6:05 AM 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

[PATCH 22/22] sched/idle: Mark arch_cpu_idle_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
h-specific implementation might return. It also improves code generation for both caller and callee. Also fixes the following warning: vmlinux.o: warning: objtool: do_idle+0x25f: unreachable instruction Reported-by: Paul E. McKenney Tested-by: Paul E. McKenney Signed-off-by: Josh

[PATCH 21/22] sched/idle: Make sure weak version of arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
arch_cpu_idle_dead() should never return. Make it so. Signed-off-by: Josh Poimboeuf --- kernel/sched/idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index e9ef66be2870..56e152f06d0f 100644 --- a/kernel/sched/idle.c +++ b

[PATCH 20/22] xtensa/cpu: Mark cpu_die() __noreturn

2023-02-03 Thread Josh Poimboeuf
cpu_die() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/xtensa/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/include/asm/smp.h b/arch/xtensa/include

[PATCH 18/22] x86/cpu: Mark play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/smp.h | 2 +- arch/x86/kernel/process.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include

[PATCH 19/22] xtensa/cpu: Make sure cpu_die() doesn't return

2023-02-03 Thread Josh Poimboeuf
cpu_die() 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. Signed-off-by: Josh Poimboeuf

[PATCH 17/22] x86/cpu: Make sure play_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
e function into whatever code happens to be next. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/smp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index b4dbb20dab1a..8f628e08b25a 100644 --- a/arch/x86/include/asm/smp.h +++

[PATCH 15/22] sh/cpu: Expose arch_cpu_idle_dead()'s prototype definition

2023-02-03 Thread Josh Poimboeuf
Include to make sure arch_cpu_idle_dead() matches its prototype going forward. Signed-off-by: Josh Poimboeuf --- arch/sh/kernel/idle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 3418c40f0099..114f0c4abeac 100644 --- a/arch/sh/kernel

[PATCH 16/22] sparc/cpu: Mark cpu_play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
cpu_play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/sparc/include/asm/smp_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc

[PATCH 13/22] sh/cpu: Make sure play_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
play_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. Signed-off-by: Josh Poimboeuf

[PATCH 14/22] sh/cpu: Mark play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/sh/include/asm/smp-ops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/asm/smp-ops.h b/arch/sh/include

[PATCH 12/22] powerpc/cpu: Mark start_secondary_resume() __noreturn

2023-02-03 Thread Josh Poimboeuf
start_secondary_resume() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/powerpc/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/smp.h b/arch

[PATCH 10/22] mips/cpu: Make sure play_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
play_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. Signed-off-by: Josh Poimboeuf

[PATCH 11/22] mips/cpu: Mark play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/mips/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm

[PATCH 09/22] mips/cpu: Expose play_dead()'s prototype definition

2023-02-03 Thread Josh Poimboeuf
Include to make sure play_dead() matches its prototype going forward. Signed-off-by: Josh Poimboeuf --- arch/mips/kernel/smp-bmips.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index f5d7bfa3472a..df9158e8329d 100644

[PATCH 08/22] loongarch/cpu: Mark play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/loongarch/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/smp.h b/arch/loongarch

[PATCH 07/22] loongarch/cpu: Make sure play_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
play_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. Signed-off-by: Josh Poimboeuf

[PATCH 06/22] ia64/cpu: Mark play_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
play_dead() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/ia64/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel

[PATCH 05/22] csky/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
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. Signed-off-by: Josh

[PATCH 04/22] arm64/cpu: Mark cpu_die() __noreturn

2023-02-03 Thread Josh Poimboeuf
cpu_die() doesn't return. Annotate it as such. By extension this also makes arch_cpu_idle_dead() noreturn. Signed-off-by: Josh Poimboeuf --- arch/arm64/include/asm/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/smp.h b/arch/arm64/include/asm

[PATCH 03/22] arm/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
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. Signed-off-by: Josh

[PATCH 00/22] cpu,sched: Mark arch_cpu_idle_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
] 076cbf5d2163 ("x86/xen: don't let xen_pv_play_dead() return") Josh Poimboeuf (22): alpha/cpu: Expose arch_cpu_idle_dead()'s prototype declaration alpha/cpu: Make sure arch_cpu_idle_dead() doesn't return arm/cpu: Make sure arch_cpu_idle_dead() doesn't return arm64/cpu: Ma

[PATCH 02/22] alpha/cpu: Make sure arch_cpu_idle_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
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. Signed-off-by: Josh

[PATCH 01/22] alpha/cpu: Expose arch_cpu_idle_dead()'s prototype declaration

2023-02-03 Thread Josh Poimboeuf
Include to make sure arch_cpu_idle_dead() matches its prototype going forward. Signed-off-by: Josh Poimboeuf --- arch/alpha/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 0eddd22c6212..4813172547b5 100644

Re: [PATCH 2/2] powerpc/module_64: Fix "expected nop" error on module re-patching

2023-01-25 Thread Josh Poimboeuf
On Wed, Jan 25, 2023 at 09:36:02AM -0800, Song Liu wrote: > On Wed, Jan 25, 2023 at 8:46 AM Josh Poimboeuf wrote: > > > > On Tue, Jan 24, 2023 at 10:09:56PM -0800, Song Liu wrote: > > > > @@ -514,9 +515,18 @@ static int restore_r2(const char *name, u32 > > &g

Re: [PATCH 2/2] powerpc/module_64: Fix "expected nop" error on module re-patching

2023-01-25 Thread Josh Poimboeuf
On Tue, Jan 24, 2023 at 10:09:56PM -0800, Song Liu wrote: > > @@ -514,9 +515,18 @@ static int restore_r2(const char *name, u32 > > *instruction, struct module *me) > > if (!instr_is_relative_link_branch(ppc_inst(*prev_insn))) > > return 0; > > > > - if (*instruction

[PATCH 1/2] powerpc/module_64: Improve restore_r2() return semantics

2023-01-24 Thread Josh Poimboeuf
restore_r2() returns 1 on success, which is surprising for a non-boolean function. Change it to return 0 on success and -errno on error to match kernel coding convention. Signed-off-by: Josh Poimboeuf --- arch/powerpc/kernel/module_64.c | 15 ++- 1 file changed, 6 insertions(+), 9

[PATCH 0/2] powerpc: Fix livepatch module re-patching issue

2023-01-24 Thread Josh Poimboeuf
Fix a livepatch bug seen when reloading a patched module. This is the powerpc counterpart to Song Liu's fix for a similar issue on x86: https://lkml.kernel.org/lkml/20230121004945.697003-2-s...@kernel.org Josh Poimboeuf (2): powerpc/module_64: Improve restore_r2() return semantics powerpc

[PATCH 2/2] powerpc/module_64: Fix "expected nop" error on module re-patching

2023-01-24 Thread Josh Poimboeuf
function was patched the first time. So the instruction wasn't a nop as expected. When the restore r2 instruction has already been patched in, detect that and skip the warning and the instruction write. Signed-off-by: Josh Poimboeuf --- arch/powerpc/kernel/module_64.c | 14 -- 1 file

Re: [PATCH] scripts/faddr2line: Fix regression in name resolution on ppc64le

2022-11-14 Thread Josh Poimboeuf
On Mon, Nov 14, 2022 at 12:21:33PM +, Christophe Leroy wrote: > Gentle ping ... Can this fix be merged ? Thanks for the reminder. Looks good, I'll go ahead and take it. -- Josh

Re: [PATCH v4 00/16] objtool: Enable and implement --mcount option on powerpc

2022-10-12 Thread Josh Poimboeuf
On Tue, Oct 11, 2022 at 01:20:02PM -0700, Josh Poimboeuf wrote: > On Mon, Oct 10, 2022 at 05:19:02PM +0530, Naveen N. Rao wrote: > > All the above changes are down to compiler optimizations and shuffling due > > to CONFIG_OBJTOOL being enabled and changing annot

Re: [PATCH v4 11/16] objtool: Add --mnop as an option to --mcount

2022-10-11 Thread Josh Poimboeuf
On Mon, Oct 10, 2022 at 05:07:46PM +0530, Naveen N. Rao wrote: > > +++ b/scripts/Makefile.lib > > @@ -234,6 +234,7 @@ objtool_args = > > \ > > $(if $(CONFIG_HAVE_NOINSTR_HACK), --hacks=noinstr) \ > > $(if

Re: [objtool] ca5e2b42c0: kernel_BUG_at_arch/x86/kernel/jump_label.c

2022-09-28 Thread Josh Poimboeuf
On Wed, Sep 28, 2022 at 08:44:27AM -0700, Nathan Chancellor wrote: > This crash appears to just be a symptom of objtool erroring throughout > the entire build, which means things like the jump label hacks do not > get applied. I see a flood of > > error: objtool: --mnop requires --mcount > >

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Josh Poimboeuf
On Mon, Sep 12, 2022 at 06:31:14AM -0500, Segher Boessenkool wrote: > Hi! > > On Fri, Sep 09, 2022 at 11:07:04AM -0700, Josh Poimboeuf wrote: > > 2) Noreturn functions: > > > >There's no reliable way to determine which functions are designated > >by th

Re: [PATCH v3 00/16] objtool: Enable and implement --mcount option on powerpc

2022-09-13 Thread Josh Poimboeuf
On Tue, Sep 13, 2022 at 04:13:52PM +0200, Peter Zijlstra wrote: > On Mon, Sep 12, 2022 at 01:50:04PM +0530, Sathvika Vasireddy wrote: > > Christophe Leroy (4): > > objtool: Fix SEGFAULT > > objtool: Use target file endianness instead of a compiled constant > > objtool: Use target file class

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-13 Thread Josh Poimboeuf
On Tue, Sep 13, 2022 at 03:51:44PM -0700, Indu Bhagat wrote: > Curious to know what all features of objtool rely on the need to reverse > engineer the control flow graph. Is it a larger set or it is only for ORC > generation ? Objtool features which rely on the CFG: - Frame pointer rule

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-13 Thread Josh Poimboeuf
On Mon, Sep 12, 2022 at 02:17:36PM +, Michael Matz wrote: > Hey, Hi Michael, Thanks for looking at this. > On Mon, 12 Sep 2022, Borislav Petkov wrote: > > > Micha, any opinions on the below are appreciated. > > > > On Fri, Sep 09, 2022 at 11:07:04AM

[RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-09 Thread Josh Poimboeuf
Hi, Here's a preview of what I'm planning to discuss at the LPC toolchains microconference. Feel free to start the discussion early :-) This is a proposal for some new minor GCC/Clang features which would help objtool greatly. Background -- Objtool is a kernel-specific tool which

Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions

2022-05-12 Thread Josh Poimboeuf
On Thu, May 12, 2022 at 02:52:40PM +, Christophe Leroy wrote: > Hi Josh, > > Le 28/03/2022 à 21:59, Josh Poimboeuf a écrit : > > On Sun, Mar 27, 2022 at 09:09:20AM +, Christophe Leroy wrote: > >> What are current works in progress on objtool ? Should I wait Jo

[PATCH v2] bug: Use normal relative pointers in 'struct bug_entry'

2022-05-12 Thread Josh Poimboeuf
the normal way. Acked-by: Peter Zijlstra (Intel) Acked-by: Sven Schnelle # s390 Reviewed-by: Mark Rutland Tested-by: Mark Rutland [arm64] Acked-by: Michael Ellerman (powerpc) Acked-by: Catalin Marinas Signed-off-by: Josh Poimboeuf --- v2: - fix ppc64le C macros (and actually test them) arch

Re: [PATCH] bug: Use normal relative pointers in 'struct bug_entry'

2022-05-09 Thread Josh Poimboeuf
On Mon, May 09, 2022 at 10:31:14PM +1000, Michael Ellerman wrote: > Embarrassingly, we have another copy of the logic, used in the C > versions, they need updating too: Oops, thanks for finding that. > With that added it seems to be working correctly for me. > > Acked-by: Michael Ellerman

[PATCH] bug: Use normal relative pointers in 'struct bug_entry'

2022-05-05 Thread Josh Poimboeuf
the normal way. Signed-off-by: Josh Poimboeuf --- arch/arm64/include/asm/asm-bug.h | 4 ++-- arch/powerpc/include/asm/bug.h | 5 +++-- arch/riscv/include/asm/bug.h | 4 ++-- arch/s390/include/asm/bug.h | 5 +++-- arch/x86/include/asm/bug.h | 2 +- lib/bug.c

Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions

2022-03-29 Thread Josh Poimboeuf
On Tue, Mar 29, 2022 at 05:32:18PM +, Christophe Leroy wrote: > > > Le 29/03/2022 à 14:01, Michael Ellerman a écrit : > > Josh Poimboeuf writes: > >> On Sun, Mar 27, 2022 at 09:09:20AM +, Christophe Leroy wrote: > >>> Second point is the endianess

Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions

2022-03-28 Thread Josh Poimboeuf
On Mon, Mar 28, 2022 at 10:14:38PM +0200, Peter Zijlstra wrote: > > FWIW, there have been some objtool patches for arm64 stack validation, > > but the arm64 maintainers have been hesitant to get on board with > > objtool, as it brings a certain maintenance burden. Especially for the > > full

Re: [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions

2022-03-28 Thread Josh Poimboeuf
On Sun, Mar 27, 2022 at 09:09:20AM +, Christophe Leroy wrote: > Second point is the endianess and 32/64 selection, especially when > crossbuilding. There is already some stuff regarding endianess based on > bswap_if_needed() but that's based on constant selection at build time > and I

Re: [RFC PATCH 0/3] objtool: Add mcount sub-command

2022-03-18 Thread Josh Poimboeuf
On Fri, Mar 18, 2022 at 04:21:37PM +0530, Sathvika Vasireddy wrote: > This patchset adds support to implement 'objtool mcount' command. > > Right now, objtool is built if CONFIG_STACK_VALIDATION is enabled. > And, '__mcount_loc' section is generated by objtool when --mcount > option is passed to

Re: [PATCH v1 2/2] static_call: Remove __DEFINE_STATIC_CALL macro

2022-03-15 Thread Josh Poimboeuf
TATIC_CALL_NULL() in that case. > > Signed-off-by: Christophe Leroy Acked-by: Josh Poimboeuf -- Josh

Re: [PATCH v1 1/2] static_call: Properly initialise DEFINE_STATIC_CALL_RET0()

2022-03-15 Thread Josh Poimboeuf
L_RET0_TRAMP(name) __PPC_SCT(name, "b > .+20") There's a PPC_SCT_RET0 macro for this "20" offset, might as well use a stringified version of that for robustness/readability. Otherwise it looks reasonable. Acked-by: Josh Poimboeuf -- Josh

Re: [PATCH] static_call: Don't make __static_call_return0 static

2022-03-15 Thread Josh Poimboeuf
l_transform() won't recognise it. > > In order to work properly, global single instance of __static_call_return0() > is required. > > Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()") > Signed-off-by: Christophe Leroy Acked-by: Josh Poimboeuf -- Josh

Re: [PATCH 04/13] livepatch: move klp_find_object_module to module.c

2021-01-21 Thread Josh Poimboeuf
On Thu, Jan 21, 2021 at 08:49:50AM +0100, Christoph Hellwig wrote: > @@ -820,14 +796,25 @@ static int klp_init_object(struct klp_patch *patch, > struct klp_object *obj) > const char *name; > > obj->patched = false; > - obj->mod = NULL; Why was this line removed? > if

Re: [PATCH v2 5/5] arm64/speculation: Support 'mitigations=' cmdline option

2019-04-16 Thread Josh Poimboeuf
On Tue, Apr 16, 2019 at 09:26:13PM +0200, Thomas Gleixner wrote: > On Fri, 12 Apr 2019, Josh Poimboeuf wrote: > > > Configure arm64 runtime CPU speculation bug mitigations in accordance > > with the 'mitigations=' cmdline option. This affects Meltdown, Spectre > > v

Re: [PATCH v2 1/5] cpu/speculation: Add 'mitigations=' cmdline option

2019-04-16 Thread Josh Poimboeuf
On Tue, Apr 16, 2019 at 04:13:35PM +0200, Borislav Petkov wrote: > On Fri, Apr 12, 2019 at 03:39:28PM -0500, Josh Poimboeuf wrote: > > diff --git a/kernel/cpu.c b/kernel/cpu.c > > index 38890f62f9a8..aed9083f8eac 100644 > > --- a/kernel/cpu.c > > +++ b/kernel/cpu.c >

  1   2   3   >