Re: [PATCH][v4] livepatch/ppc: Enable livepatching on powerpc

2016-03-04 Thread Josh Poimboeuf
Hi Petr, On Thu, Mar 03, 2016 at 05:52:01PM +0100, Petr Mladek wrote: > From: Balbir Singh > > Changelog v4: > 1. Renamed klp_matchaddr() to klp_get_ftrace_location() > and used it just to convert the function address. > 2. Synced klp_write_module_reloc() with s390(); made i

Re: How to merge? (was Re: [PATCH][v4] livepatch/ppc: Enable livepatching on powerpc)

2016-03-07 Thread Josh Poimboeuf
On Mon, Mar 07, 2016 at 11:52:31PM +0100, Jiri Kosina wrote: > On Mon, 7 Mar 2016, Michael Ellerman wrote: > > > > This aligns with my usual workflow, so that'd be my preferred way of doing > > > things; i.e. you put all the ftrace changes into a separate topic branch, > > > and then > > > > > > -

Re: [PATCH] livepatch: Add some basic LivePatch documentation

2016-03-10 Thread Josh Poimboeuf
On Wed, Mar 09, 2016 at 03:01:46PM +0100, Petr Mladek wrote: > LivePatch framework deserves some documentation, definitely. > This is an attempt to provide some basic info. I hope that > it will be useful for both LivePatch producers and also > potential developers of the framework itself. > > Sig

Re: [PATCH 0/5] Live patching for powerpc

2016-04-14 Thread Josh Poimboeuf
On Thu, Apr 14, 2016 at 05:20:29PM +0200, Torsten Duwe wrote: > On Thu, Apr 14, 2016 at 11:08:02PM +1000, Michael Ellerman wrote: > > On Thu, 2016-04-14 at 14:57 +0200, Torsten Duwe wrote: > > > > > FTR: then I still have a few ppc64 hunks floating around to support > > > certain consistency > >

Re: [PATCH 0/5] Live patching for powerpc

2016-04-15 Thread Josh Poimboeuf
On Fri, Apr 15, 2016 at 09:22:49PM +1000, Michael Ellerman wrote: > On Thu, 2016-04-14 at 11:41 -0500, Josh Poimboeuf wrote: > > On Thu, Apr 14, 2016 at 05:20:29PM +0200, Torsten Duwe wrote: > > > On Thu, Apr 14, 2016 at 11:08:02PM +1000, Michael Ellerman wrote: > > > &g

Re: [PATCH v2] livepatch: Add some basic LivePatch documentation

2016-04-26 Thread Josh Poimboeuf
On Mon, Apr 25, 2016 at 05:14:35PM +0200, Petr Mladek wrote: > LivePatch framework deserves some documentation, definitely. > This is an attempt to provide some basic info. I hope that > it will be useful for both LivePatch producers and also > potential developers of the framework itself. > > Sig

[RFC PATCH v2 00/18] livepatch: hybrid consistency model

2016-04-28 Thread Josh Poimboeuf
fset() errors from EINVAL -> ENOENT - change proc file permissions S_IRUGO -> USR - use klp_for_each_object/func helpers Jiri Slaby (1): livepatch/s390: reorganize TIF thread flag bits Josh Poimboeuf (16): x86/asm/head: clean up initial stack variable x86/asm/head: use a common fun

[RFC PATCH v2 01/18] x86/asm/head: clean up initial stack variable

2016-04-28 Thread Josh Poimboeuf
d cleanups: - Remove the unused init_rsp variable declaration. - Remove the ".word 0" statement after the initial_stack definition because it has no apparent function. Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/realmode.h | 2 +- arch/x86/include/asm/smp.h | 3 ---

[RFC PATCH v2 02/18] x86/asm/head: use a common function for starting CPUs

2016-04-28 Thread Josh Poimboeuf
There are two different pieces of code for starting a CPU: start_cpu0() and the end of secondary_startup_64(). They're identical except for the stack setup. Combine the common parts into a shared start_cpu() function. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/head_64.S

[RFC PATCH v2 03/18] x86/asm/head: standardize the bottom of the stack for idle tasks

2016-04-28 Thread Josh Poimboeuf
a stack at all Make the idle tasks conform to the new stack bottom convention by starting their stack at a sizeof(pt_regs) offset from the end of the stack page. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/head_64.S | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[RFC PATCH v2 04/18] x86: move _stext marker before head code

2016-04-28 Thread Josh Poimboeuf
h the intent of other users of the _stext symbol, and it also seems consistent with what other architectures are already doing. Signed-off-by: Josh Poimboeuf --- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arc

[RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-04-28 Thread Josh Poimboeuf
-off-by: Josh Poimboeuf --- include/linux/sched.h | 1 + kernel/fork.c | 2 +- kernel/sched/core.c | 4 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 3d31572..fb364a0 100644 --- a/include/linux/sched.h +++ b/include

[RFC PATCH v2 06/18] x86: dump_trace() error handling

2016-04-28 Thread Josh Poimboeuf
In preparation for being able to determine whether a given stack trace is reliable, allow the stacktrace_ops functions to propagate errors to dump_trace(). Signed-off-by: Josh Poimboeuf --- arch/x86/include/asm/stacktrace.h | 36 +++--- arch/x86/kernel/dumpstack.c | 31

[RFC PATCH v2 07/18] stacktrace/x86: function for detecting reliable stack traces

2016-04-28 Thread Josh Poimboeuf
Signed-off-by: Josh Poimboeuf --- arch/Kconfig | 6 arch/x86/Kconfig | 1 + arch/x86/kernel/dumpstack.c | 77 arch/x86/kernel/stacktrace.c | 24 ++ include/linux/kernel.h | 1 + include/linux/stac

[RFC PATCH v2 08/18] livepatch: temporary stubs for klp_patch_pending() and klp_patch_task()

2016-04-28 Thread Josh Poimboeuf
Create temporary stubs for klp_patch_pending() and klp_patch_task() so we can add TIF_PATCH_PENDING to different architectures in separate patches without breaking build bisectability. Signed-off-by: Josh Poimboeuf --- include/linux/livepatch.h | 7 ++- kernel/livepatch/core.c | 3 +++ 2

[RFC PATCH v2 09/18] livepatch/x86: add TIF_PATCH_PENDING thread flag

2016-04-28 Thread Josh Poimboeuf
flags so that it gets automatically included in the _TIF_ALLWORK_MASK macro. This results in exit_to_usermode_loop() and klp_patch_task() getting called when the bit is set. Signed-off-by: Josh Poimboeuf --- arch/x86/entry/common.c| 9 ++--- arch/x86/include/asm/thread_info.h | 2

[RFC PATCH v2 10/18] livepatch/powerpc: add TIF_PATCH_PENDING thread flag

2016-04-28 Thread Josh Poimboeuf
do_notify_resume() and klp_patch_task() get called when the bit is set. Signed-off-by: Josh Poimboeuf --- arch/powerpc/include/asm/thread_info.h | 4 +++- arch/powerpc/kernel/signal.c | 4 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/thread_info.h

[RFC PATCH v2 11/18] livepatch/s390: reorganize TIF thread flag bits

2016-04-28 Thread Josh Poimboeuf
From: Jiri Slaby Group the TIF thread flag bits by their inclusion in the _TIF_WORK and _TIF_TRACE macros. Signed-off-by: Jiri Slaby Signed-off-by: Josh Poimboeuf --- arch/s390/include/asm/thread_info.h | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git

[RFC PATCH v2 12/18] livepatch/s390: add TIF_PATCH_PENDING thread flag

2016-04-28 Thread Josh Poimboeuf
sk is correctly migrated in all return paths from a syscall. Signed-off-by: Miroslav Benes Signed-off-by: Josh Poimboeuf --- arch/s390/include/asm/thread_info.h | 2 ++ arch/s390/kernel/entry.S| 31 ++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --

[RFC PATCH v2 13/18] livepatch: separate enabled and patched states

2016-04-28 Thread Josh Poimboeuf
gistered with ftrace and added to the klp_ops func stack. Also, since these states are binary, represent them with booleans instead of ints. Signed-off-by: Josh Poimboeuf --- include/linux/livepatch.h | 17 --- kernel/livepatch/core.c | 72 +++-

[RFC PATCH v2 14/18] livepatch: remove unnecessary object loaded check

2016-04-28 Thread Josh Poimboeuf
klp_patch_object()'s callers already ensure that the object is loaded, so its call to klp_is_object_loaded() is unnecessary. This will also make it possible to move the patching code into a separate file. Signed-off-by: Josh Poimboeuf --- kernel/livepatch/core.c | 3 --- 1 file chang

[RFC PATCH v2 15/18] livepatch: move patching functions into patch.c

2016-04-28 Thread Josh Poimboeuf
Move functions related to the actual patching of functions and objects into a new patch.c file. Signed-off-by: Josh Poimboeuf --- kernel/livepatch/Makefile | 2 +- kernel/livepatch/core.c | 202 +-- kernel/livepatch/patch.c | 213

[RFC PATCH v2 16/18] livepatch: store function sizes

2016-04-28 Thread Josh Poimboeuf
For the consistency model we'll need to know the sizes of the old and new functions to determine if they're on the stacks of any tasks. Signed-off-by: Josh Poimboeuf --- include/linux/livepatch.h | 3 +++ kernel/livepatch/core.c | 16 2 files changed, 19 insertion

[RFC PATCH v2 17/18] livepatch: change to a per-task consistency model

2016-04-28 Thread Josh Poimboeuf
the /sys/kernel/livepatch//enabled file while the transition is in progress. Then all the tasks will attempt to converge back to the original patch state. [1] https://lkml.kernel.org/r/20141107140458.ga21...@suse.cz Signed-off-by: Josh Poimboeuf --- Documentation/ABI/testing/sysfs-kernel-livepa

[RFC PATCH v2 18/18] livepatch: add /proc//patch_state

2016-04-28 Thread Josh Poimboeuf
Expose the per-task patch state value so users can determine which tasks are holding up completion of a patching operation. Signed-off-by: Josh Poimboeuf --- Documentation/filesystems/proc.txt | 18 ++ fs/proc/base.c | 15 +++ 2 files changed, 33

[PATCH RFC 0/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
27;s vulnerable. - cpu_spec_mitigations=auto,nosmt: Enable all the default mitigations, disabling SMT if needed by a mitigation. Josh Poimboeuf (5): cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline

[PATCH RFC 2/5] x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
Configure x86 runtime CPU speculation bug mitigations in accordance with the 'cpu_spec_mitigations=' cmdline options. This affects Meltdown, Spectre v2, Speculative Store Bypass, and L1TF. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- .../admin-gu

[PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
27;s vulnerable. - cpu_spec_mitigations=auto,nosmt: Enable all the default mitigations, disabling SMT if needed by a mitigation. Currently, these options are placeholders which don't actually do anything. They will be fleshed out in upcoming patches. Signed-off-by: Josh Poimboeuf --- .../admin-guide/k

[PATCH RFC 3/5] powerpc/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
Configure powerpc CPU runtime speculation bug mitigations in accordance with the 'cpu_spec_mitigations=' cmdline options. This affects Meltdown, Spectre v1, Spectre v2, and Speculative Store Bypass. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/a

[PATCH RFC 4/5] s390/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
Configure s390 runtime CPU speculation bug mitigations in accordance with the 'cpu_spec_mitigations=' cmdline options. This affects Spectre v1 and Spectre v2. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/kernel-parameters.txt | 7 +++

[PATCH RFC 5/5] arm64/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
Configure arm64 runtime CPU speculation bug mitigations in accordance with the 'cpu_spec_mitigations=' cmdline options. This affects Meltdown and Speculative Store Bypass. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/kernel-paramete

Re: [PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-04 Thread Josh Poimboeuf
On Thu, Apr 04, 2019 at 11:44:11AM -0500, Josh Poimboeuf wrote: > Keeping track of the number of mitigations for all the CPU speculation > bugs has become overwhelming for many users. It's getting more and more > complicated to decide which mitigations are needed for a given

Re: [PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 03:12:11PM +0200, Borislav Petkov wrote: > On Thu, Apr 04, 2019 at 11:44:11AM -0500, Josh Poimboeuf wrote: > > Keeping track of the number of mitigations for all the CPU speculation > > bugs has become overwhelming for many users. It's getting more and

Re: [PATCH RFC 2/5] x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 03:57:12PM +0200, Borislav Petkov wrote: > > diff --git a/arch/x86/include/asm/processor.h > > b/arch/x86/include/asm/processor.h > > index 2bb3a648fc12..7e95b310f869 100644 > > --- a/arch/x86/include/asm/processor.h > > +++ b/arch/x86/include/asm/processor.h > > @@ -982,6

Re: [PATCH RFC 5/5] arm64/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 03:39:58PM +0100, Steven Price wrote: > On 04/04/2019 17:44, Josh Poimboeuf wrote: > > Configure arm64 runtime CPU speculation bug mitigations in accordance > > with the 'cpu_spec_mitigations=' cmdline options. This affects > > Meltdo

Re: [PATCH RFC 2/5] x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 08:18:09AM -0700, Randy Dunlap wrote: > On 4/5/19 6:57 AM, Borislav Petkov wrote: > > On Thu, Apr 04, 2019 at 11:44:12AM -0500, Josh Poimboeuf wrote: > >> Configure x86 runtime CPU speculation bug mitigations in accordance with > >> the 

Re: [PATCH RFC 5/5] arm64/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 03:44:14PM +0100, Will Deacon wrote: > Hi Josh, > > On Thu, Apr 04, 2019 at 11:44:15AM -0500, Josh Poimboeuf wrote: > > Configure arm64 runtime CPU speculation bug mitigations in accordance > > with the 'cpu_spec_mitigations=' cmdline opti

Re: [PATCH RFC 2/5] x86/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 05:26:50PM +0200, Borislav Petkov wrote: > On Fri, Apr 05, 2019 at 09:31:01AM -0500, Josh Poimboeuf wrote: > > My thinking was that the individual options could be used to override > > the global option. But maybe that's overkill? I dunno. >

Re: [PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-05 Thread Josh Poimboeuf
On Fri, Apr 05, 2019 at 06:01:36PM +0200, Borislav Petkov wrote: > Thinking about this more, we can shave off the first 4 chars and have it > be: > > spec_mitigations= > > I think it is painfully clear which speculation mitigations we mean. And > the other switches don't have "cpu_" prefixes too

Re: [PATCH RFC 3/5] powerpc/speculation: Add support for 'cpu_spec_mitigations=' cmdline options

2019-04-10 Thread Josh Poimboeuf
On Wed, Apr 10, 2019 at 04:06:50PM +1000, Michael Ellerman wrote: > Josh Poimboeuf writes: > > Configure powerpc CPU runtime speculation bug mitigations in accordance > > with the 'cpu_spec_mitigations=' cmdline options. This affects > > Meltdown, Spectre v1, Sp

Re: [PATCH RFC 1/5] cpu/speculation: Add 'cpu_spec_mitigations=' cmdline options

2019-04-11 Thread Josh Poimboeuf
On Wed, Apr 10, 2019 at 02:10:01PM +0200, Thomas Gleixner wrote: > On Wed, 10 Apr 2019, Michael Ellerman wrote: > > Josh Poimboeuf writes: > > > > > On Fri, Apr 05, 2019 at 06:01:36PM +0200, Borislav Petkov wrote: > > >> Thinking about this more, we can sha

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

2019-04-12 Thread Josh Poimboeuf
gations=auto: [default] Enable all the default mitigations, but leave SMT enabled, even if it's vulnerable. - mitigations=auto,nosmt: Enable all the default mitigations, disabling SMT if needed by a mitigation. Josh Poimboeuf (5): cpu/speculation: Add 'mitigations=' cmd

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

2019-04-12 Thread Josh Poimboeuf
smt: Enable all the default mitigations, disabling SMT if needed by a mitigation. Currently, these options are placeholders which don't actually do anything. They will be fleshed out in upcoming patches. Signed-off-by: Josh Poimboeuf --- .../admin-guide/kernel-paramet

[PATCH v2 2/5] x86/speculation: Support 'mitigations=' cmdline option

2019-04-12 Thread Josh Poimboeuf
Configure x86 runtime CPU speculation bug mitigations in accordance with the 'mitigations=' cmdline option. This affects Meltdown, Spectre v2, Speculative Store Bypass, and L1TF. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/admin-gu

[PATCH v2 3/5] powerpc/speculation: Support 'mitigations=' cmdline option

2019-04-12 Thread Josh Poimboeuf
Configure powerpc CPU runtime speculation bug mitigations in accordance with the 'mitigations=' cmdline option. This affects Meltdown, Spectre v1, Spectre v2, and Speculative Store Bypass. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/admin-gu

[PATCH v2 4/5] s390/speculation: Support 'mitigations=' cmdline option

2019-04-12 Thread Josh Poimboeuf
Configure s390 runtime CPU speculation bug mitigations in accordance with the 'mitigations=' cmdline option. This affects Spectre v1 and Spectre v2. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/kernel-parameters.txt | 5 +++-- arch/s

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

2019-04-12 Thread Josh Poimboeuf
Configure arm64 runtime CPU speculation bug mitigations in accordance with the 'mitigations=' cmdline option. This affects Meltdown, Spectre v2, and Speculative Store Bypass. The default behavior is unchanged. Signed-off-by: Josh Poimboeuf --- NOTE: This is based on top of Jerem

[PATCH] Documentation: Add ARM64 to kernel-parameters.rst

2019-04-12 Thread Josh Poimboeuf
Add ARM64 to the legend of architectures. It's already used in several places in kernel-parameters.txt. Suggested-by: Randy Dunlap Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/kernel-parameters.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/admin-

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 >

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 &

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-14 Thread Josh Poimboeuf
On Mon, Jan 14, 2019 at 11:46:59AM -0500, Joe Lawrence wrote: > @@ -158,11 +158,21 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk, > return 1; /* invalid backlink, too far up. */ > } > > + /* We can only trust the bottom frame's backlink,

Re: [PATCH 0/4] powerpc/livepatch: reliable stack unwinder fixes

2019-01-29 Thread Josh Poimboeuf
eption return > > arch/powerpc/Kconfig | 2 +- > arch/powerpc/kernel/entry_64.S | 7 +++ > arch/powerpc/kernel/stacktrace.c | 74 +++++--- > 3 files changed, 47 insertions(+), 36 deletions(-) Reviewed-by: Josh Poimboeuf -- Josh

Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel

2011-11-02 Thread Josh Poimboeuf
and comments are welcome. >From c88ae39da0c0352f411aca8d9636990a442d47da Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Wed, 2 Nov 2011 16:41:24 -0500 Subject: [PATCH] Flush relocated instructions from data cache After updating instructions with relocated addresses, flush them from the da

Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel

2011-11-07 Thread Josh Poimboeuf
On Fri, 2011-11-04 at 14:06 +0530, Suzuki Poulose wrote: > On 11/03/11 05:06, Josh Poimboeuf wrote: > > On Tue, 2011-10-25 at 17:23 +0530, Suzuki K. Poulose wrote: > > @@ -137,6 +137,9 @@ get_type: > > lwz r0, 8(r9) /* r_addend */ > > add r0,

Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel

2011-11-08 Thread Josh Poimboeuf
On Tue, 2011-11-08 at 12:41 +0530, Suzuki Poulose wrote: > What I was suggesting is, instead of flushing the cache in relocate(), lets > do it > like: > > for e.g, on 440x, (in head_44x.S :) > > #ifdef CONFIG_RELOCATABLE > ... > bl relocate > > #Flush the d-cache and invalidat

Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel

2011-11-09 Thread Josh Poimboeuf
On Wed, 2011-11-09 at 12:03 +0530, Suzuki Poulose wrote: > On Tue, 08 Nov 2011 10:19:05 -0600 > Josh Poimboeuf wrote: > > > On Tue, 2011-11-08 at 12:41 +0530, Suzuki Poulose wrote: > > > What I was suggesting is, instead of flushing the cache in > >

Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel

2011-11-10 Thread Josh Poimboeuf
On Thu, 2011-11-10 at 08:01 +0530, Suzuki Poulose wrote: > >> How about using clean_dcache_range() to flush the range runtime > >> address range [ _stext, _end ] ? That would flush the entire > >> instructions. > > > > Wouldn't that result in more cache flushing than the original solution? > > > >

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

2023-04-18 Thread Josh Poimboeuf
-0-46a69b507...@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] objtool: Make 'sec-address' always on

2023-06-21 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 u

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 d

[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 reve

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

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 validatio

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 s

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 > >

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 > > th

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 $(CONFIG_X86_KE

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 annotate_unreachable(). &

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 to

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

2023-01-24 Thread Josh Poimboeuf
lp module's replacement function when the original 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 ---

[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 po

[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

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 !

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

[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

[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:

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

2023-02-03 Thread Josh Poimboeuf
attribute. [1] 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()

[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:

[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/includ

[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:

[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/k

[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 Poim

[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/loon

[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 --- a

[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/includ

[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 Poim

[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

[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/in

[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 Poim

[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/

[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 17/22] x86/cpu: Make sure play_dead() doesn't return

2023-02-03 Thread Josh Poimboeuf
of the 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 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 Poim

[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/in

[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/in

[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 22/22] sched/idle: Mark arch_cpu_idle_dead() __noreturn

2023-02-03 Thread Josh Poimboeuf
plain if an arch-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 Sign

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

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 > HOSTLD

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.

  1   2   3   4   >