Re: [PATCH 26/33] x86/kvm: Add stack frame dependency to test_cc() inline asm

2016-01-22 Thread Josh Poimboeuf
On Fri, Jan 22, 2016 at 11:05:06AM +0100, Paolo Bonzini wrote: > > > On 21/01/2016 23:49, Josh Poimboeuf wrote: > > With some configs, gcc doesn't inline test_cc(). When that happens, it > > doesn't create a stack frame before inserting the call instruction. > >

Re: [PATCH 23/33] x86/asm/bpf: Create stack frames in bpf_jit.S

2016-01-22 Thread Josh Poimboeuf
On Fri, Jan 22, 2016 at 09:18:23AM -0800, Alexei Starovoitov wrote: > On Fri, Jan 22, 2016 at 09:58:04AM -0600, Josh Poimboeuf wrote: > > On Thu, Jan 21, 2016 at 08:18:46PM -0800, Alexei Starovoitov wrote: > > > On Thu, Jan 21, 2016 at 09:55:31PM -0600, Josh Poimboeuf wrote: >

Re: [PATCH v5] ftrace/module: remove ftrace module notifier

2016-02-16 Thread Josh Poimboeuf
; > Reviewed-by: Petr Mladek <pmla...@suse.cz> > Acked-by: Rusty Russell <ru...@rustcorp.com.au> Reviewed-by: Josh Poimboeuf <jpoim...@redhat.com> > --- > Patch based on linux-next-20160216. > > v5: > - Make the ftrace notifier patch standalon

[PATCH] sched/x86: Add stack frame dependency to __preempt_schedule[_notrace]

2016-02-18 Thread Josh Poimboeuf
he unlikely ___preempt_schedule() call path. Going through a sampling of the differences in the asm, that's the most common change I see. Otherwise it has no real effect on callers which already have stack frames (though it does result in the reordering of some 'mov's). Reported-by: Jiri Sla

Re: [PATCH 00/33] Compile-time stack metadata validation

2016-02-15 Thread Josh Poimboeuf
On Fri, Feb 12, 2016 at 09:10:11PM +0100, Peter Zijlstra wrote: > On Fri, Feb 12, 2016 at 12:32:06PM -0600, Josh Poimboeuf wrote: > > What I actually see in the listing is: > > > > decl__percpu_prefix:__preempt_count > > je 1f: > &

Re: [PATCH 00/33] Compile-time stack metadata validation

2016-02-15 Thread Josh Poimboeuf
On Mon, Feb 15, 2016 at 08:56:21AM -0800, Linus Torvalds wrote: > On Feb 15, 2016 8:31 AM, "Josh Poimboeuf" <jpoim...@redhat.com> wrote: > > > > So is the goal to optimize for size? If I replace the calls to > > __preempt_schedule[_notrace]() with real C cal

Re: [PATCH v4 4/4] livepatch/module: remove livepatch module notifier

2016-02-15 Thread Josh Poimboeuf
On Sun, Feb 14, 2016 at 11:59:00PM +0100, Jiri Kosina wrote: > On Wed, 10 Feb 2016, Jiri Kosina wrote: > > > > > Remove the livepatch module notifier in favor of directly enabling and > > > > disabling patches to modules in the module loader. Hard-coding the > > > > function calls ensures that

[PATCH] objtool: Disable stack validation when CROSS_COMPILE is used

2016-03-01 Thread Josh Poimboeuf
try to fix it then. >From a3c65947011a420743f308b698171c4209105d3f Mon Sep 17 00:00:00 2001 Message-Id: <a3c65947011a420743f308b698171c4209105d3f.1456868910.git.jpoim...@redhat.com> From: Josh Poimboeuf <jpoim...@redhat.com> Date: Tue, 1 Mar 2016 13:35:51 -0600 Subject: [PATCH]

Re: [PATCH] drm/radeon: refactor CIK tiling table initialization

2016-03-09 Thread Josh Poimboeuf
On Mon, Mar 07, 2016 at 11:45:36PM +, Deucher, Alexander wrote: > > -Original Message- > > From: Josh Poimboeuf [mailto:jpoim...@redhat.com] > > Sent: Monday, March 07, 2016 6:10 PM > > To: Deucher, Alexander; Koenig, Christian > > Cc: dri-de...@lists

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

Re: [PATCH 3/3] livepatch/module: remove livepatch module notifier

2016-03-10 Thread Josh Poimboeuf
patch->mod->name, obj->mod->name, obj->mod->name); > klp_free_object_loaded(obj); > + mutex_unlock(_mutex); > + > + return ret; > } > > -static int klp_module_notify(struct notifier_block *nb, unsigned long action, > - void *data) > +void klp_module_going(struct module *mod) > { > - int ret; > - struct module *mod = data; > struct klp_patch *patch; > struct klp_object *obj; > > - if (action != MODULE_STATE_COMING && action != MODULE_STATE_GOING) > - return 0; > + if (WARN_ON(mod->state != MODULE_STATE_GOING)) > + return; If we're removing patch 2/3, then mod->state isn't necessarily GOING. I think the check can probably just be removed altogether. With that fixed, Acked-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh

Re: [PATCH 1/3] modules: split part of complete_formation() into prepare_coming_module()

2016-03-10 Thread Josh Poimboeuf
anup after all the COMING-actions have completed. > > Signed-off-by: Jessica Yu <j...@redhat.com> Reviewed-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh

Re: [PATCH v2 2/2] livepatch/module: remove livepatch module notifier

2016-03-14 Thread Josh Poimboeuf
On Fri, Mar 11, 2016 at 03:03:48PM -0500, Jessica Yu wrote: > +/* Module can be either COMING or GOING */ IMO this comment doesn't really add anything: the below WARN_ON already says as much. Also the location of the comment right above the function is confusing: someone not familiar with the

[PATCH 05/11] objtool: Add helper macros for traversing instructions

2016-03-08 Thread Josh Poimboeuf
Add some helper macros to make it easier to traverse instructions, and to abstract the details of the instruction list implementation in preparation for creating a hash structure. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c

[PATCH 03/11] objtool: Compile with debugging symbols

2016-03-08 Thread Josh Poimboeuf
Compile objtool with debugging symbols ('-g') to help tools like perf and gdb understand what it's doing. Combined with '-O2', it's not always helpful, but it's better than nothing. Reported-by: Ingo Molnar <mi...@kernel.org> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- t

[PATCH 01/11] objtool: Prevent infinite recursion in noreturn detection

2016-03-08 Thread Josh Poimboeuf
/r/20160308154909.ga20...@gmail.com Reported-by: Ingo Molnar <mi...@kernel.org> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tools/objtool/builtin-che

[PATCH 10/11] objtool: Add several performance improvements

2016-03-08 Thread Josh Poimboeuf
user 0m1.163s sys 0m0.005s to: real 0m0.059s user 0m0.042s sys 0m0.017s for a 20x speedup. With the same object, it should be noted that the memory heap usage grew from 8MB to 62MB. Reducing the memory usage is on the TODO list. Reported-by: Ingo Molnar <mi...@kernel.o

[PATCH 08/11] objtool: Fix false positive warnings for functions with multiple switch statements

2016-03-08 Thread Josh Poimboeuf
Reported-by: Ingo Molnar <mi...@kernel.org> Reported-by: kbuild test robot <fengguang...@intel.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 145 +- 1 file changed, 100 insertions(+), 45 deleti

[PATCH 07/11] objtool: Rename some variables and functions

2016-03-08 Thread Josh Poimboeuf
ela refers to a rela entry in .rela.text. - rodata_rela refers to a rela entry in .rela.rodata. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 80 ++- tools/objtool/elf.c | 22 ++-- too

[PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory

2016-03-08 Thread Josh Poimboeuf
of brackets so gcc can find them. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/include/asm-generic/bitops/__fls.h | 2 +- tools/include/asm-generic/bitops/fls.h | 2 +- tools/include/asm-generic/bitops/fls64.h | 2 +- tools/include/linux/hashtable.h

[PATCH 06/11] objtool: Remove superflous INIT_LIST_HEAD

2016-03-08 Thread Josh Poimboeuf
The insns list is initialized twice, in cmd_check() and in decode_instructions(). Remove the latter. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/objtool/builtin-check.c b/tools/objtool/b

[PATCH 11/11] objtool: Only print one warning per function

2016-03-08 Thread Josh Poimboeuf
ed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 48 ++- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index bfeee22..7515cb2 100644 --- a/t

[PATCH 02/11] objtool: Detect infinite recursion

2016-03-08 Thread Josh Poimboeuf
I don't _think_ dead_end_function() can get into a recursive loop, but just in case, stop the loop and print a warning. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 45 +++ 1 file changed, 33 insertions(

[PATCH 04/11] objtool: Fix false positive warnings related to sibling calls

2016-03-08 Thread Josh Poimboeuf
to compare the frame pointer state. But it also accidentally compares the FENTRY state, resulting in a false positive warning. [1] https://lkml.kernel.org/r/20160308154909.ga20...@gmail.com Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/builtin-check.c | 7 ++-

[PATCH 00/11] Various objtool fixes

2016-03-08 Thread Josh Poimboeuf
Based on tip/master. These patches fix all known objtool issues: - infinite loop - sibling call false positives - switch statement jump table fix - performance improvements - print one warning per function Josh Poimboeuf (11): objtool: Prevent infinite recursion in noreturn detection

[PATCH] x86/kvm: Add stack frame dependency to fastop() inline asm

2016-03-09 Thread Josh Poimboeuf
] https://lists.01.org/pipermail/kbuild-all/2016-March/018249.html Reported-by: kbuild test robot <fengguang...@intel.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kvm/emulate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emul

[PATCH v2 2/2] drm/radeon: refactor SI tiling table initialization

2016-03-11 Thread Josh Poimboeuf
Simplify the control flow of si_tiling_mode_table_init() similar to how it was done in gfx_v7_0.c and gfx_v8_0.c. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- drivers/gpu/drm/radeon/si.c | 925 +--- 1 file changed, 439 insertions(+

[PATCH v2 1/2] drm/radeon: refactor CIK tiling table initialization

2016-03-11 Thread Josh Poimboeuf
Simplify the control flow of cik_tiling_mode_table_init() similar to how it was done in gfx_v7_0.c and gfx_v8_0.c. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- drivers/gpu/drm/radeon/cik.c | 1691 +- 1 file changed, 666 insertions(+)

Re: [PATCH] tools lib api: respect CROSS_COMPILE for the linker

2016-03-19 Thread Josh Poimboeuf
On Fri, Mar 18, 2016 at 01:45:22PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Mar 18, 2016 at 11:38:15AM -0500, Josh Poimboeuf escreveu: > > On Fri, Mar 18, 2016 at 01:25:47PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Mar 17, 2016 at 06:27:50PM +0100, Lu

Re: [PATCH] tools lib api: respect CROSS_COMPILE for the linker

2016-03-19 Thread Josh Poimboeuf
On Fri, Mar 18, 2016 at 11:38:15AM -0500, Josh Poimboeuf wrote: > On Fri, Mar 18, 2016 at 01:25:47PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Thu, Mar 17, 2016 at 06:27:50PM +0100, Lucas Stach escreveu: > > > This fixes cross compilation of libapi. > > > > Humm,

Re: [PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory

2016-03-09 Thread Josh Poimboeuf
On Wed, Mar 09, 2016 at 10:47:59AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > Copy hashtable.h from include/linux/tools.h. It's needed by objtool in > > the next patch in the series. > > > > Add some includ

Re: klp: remove superfluous errors in asm/livepatch.h

2016-03-09 Thread Josh Poimboeuf
On Wed, Mar 09, 2016 at 11:39:05AM +0100, Jiri Kosina wrote: > On Tue, 8 Mar 2016, Jessica Yu wrote: > > > Hm, I should've caught this earlier, but the notifier cleanup patch > > that removes the livepatch module notifier had kernel/module.c include > > livepatch.h for the

Re: [PATCH] livepatch: Fix the error message about unresolvable ambiguity

2016-03-09 Thread Josh Poimboeuf
resolvable ambiguity (%lu matches) on symbol '%s' in > object '%s'\n", > -args.count, name, objname); > + pr_err("unresolvable ambiguity on symbol '%s' in object '%s'\n", While you're at it, can you improve the grammar: s/on/for/ ? "unresolvable ambiguity *for* symbol..." Either way, Acked-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh

Re: [RFC PATCH v1.9 00/14] livepatch: hybrid consistency model

2016-04-05 Thread Josh Poimboeuf
On Tue, Apr 05, 2016 at 04:24:33PM +0200, Miroslav Benes wrote: > On Mon, 4 Apr 2016, Josh Poimboeuf wrote: > > > > I'd add a fake signal facility for sleeping non-migrated tasks. This > > > would accelerate a migration to a new universe. We have it in kgraft fo

Re: [RFC PATCH v1.9 00/14] livepatch: hybrid consistency model

2016-04-05 Thread Josh Poimboeuf
On Fri, Apr 01, 2016 at 03:39:44PM +0200, Petr Mladek wrote: > On Fri 2016-03-25 14:34:47, Josh Poimboeuf wrote: > > These patches are still a work in progress, but Jiri asked that I share > > them before I go on vacation next week. Based on origin/master bec

Re: Bug with paravirt ops and livepatches

2016-04-05 Thread Josh Poimboeuf
On Tue, Apr 05, 2016 at 03:07:13PM +0200, Miroslav Benes wrote: > On Mon, 4 Apr 2016, Josh Poimboeuf wrote: > > > So I think this doesn't fix the problem. Dynamic relocations are > > applied to the "patch module", whereas the above code deals with the > > in

Re: [RFC PATCH v1.9 12/14] livepatch: create per-task consistency model

2016-04-05 Thread Josh Poimboeuf
On Tue, Apr 05, 2016 at 01:36:34PM +0200, Vojtech Pavlik wrote: > On Mon, Apr 04, 2016 at 01:33:07PM -0500, Josh Poimboeuf wrote: > > On Mon, Apr 04, 2016 at 08:27:59PM +0200, Vojtech Pavlik wrote: > > > On Mon, Apr 04, 2016 at 01:21:38PM -0500, Josh Poimboeuf wrote: > >

Re: [RFC PATCH v1.9 00/14] livepatch: hybrid consistency model

2016-04-07 Thread Josh Poimboeuf
On Thu, Apr 07, 2016 at 02:10:30PM +0200, Petr Mladek wrote: > On Fri 2016-03-25 14:34:47, Josh Poimboeuf wrote: > > TODO: > > - try ftrace handler switching idea from v1 cover letter > > I have had a discussion about it with Mirek. This would help with > kthrea

Re: [RFC PATCH v1.9 07/14] x86/stacktrace: add function for detecting reliable stack traces

2016-04-07 Thread Josh Poimboeuf
On Thu, Apr 07, 2016 at 01:55:52PM +0200, Petr Mladek wrote: > On Fri 2016-03-25 14:34:54, Josh Poimboeuf wrote: > > For live patching and possibly other use cases, a stack trace is only > > useful if you can be assured that it's completely reliable. Add a new > > save_sta

Re: [RFC PATCH v1.9 05/14] sched: horrible way to detect whether a task has been preempted

2016-04-07 Thread Josh Poimboeuf
On Thu, Apr 07, 2016 at 11:47:00AM +0200, Petr Mladek wrote: > On Wed 2016-04-06 11:33:56, Josh Poimboeuf wrote: > > On Wed, Apr 06, 2016 at 03:06:19PM +0200, Petr Mladek wrote: > > > On Fri 2016-03-25 14:34:52, Josh Poimboeuf wrote: > > > > This is a horrible way to

Re: sched: horrible way to detect whether a task has been preempted

2016-04-07 Thread Josh Poimboeuf
On Thu, Apr 07, 2016 at 11:37:19PM +0200, Jiri Kosina wrote: > On Thu, 7 Apr 2016, Jessica Yu wrote: > > > Been sort of rattling my head over the scheduler code :-) Just following > > the calls in and out of __schedule() it doesn't look like there is a > > current flag/mechanism to tell whether

Re: [RFC PATCH v1.9 00/14] livepatch: hybrid consistency model

2016-04-07 Thread Josh Poimboeuf
On Thu, Apr 07, 2016 at 05:47:00PM +0200, Jiri Kosina wrote: > On Thu, 7 Apr 2016, Josh Poimboeuf wrote: > > > > > - try ftrace handler switching idea from v1 cover letter > [ ... ] > > > We probably should not check the stack in atomic context > > &

Re: [PATCH] livepatch: robustify klp_register_patch() API error checking

2016-04-07 Thread Josh Poimboeuf
the livepatch API before sanity (NULL) checking them (patch > and patch->mod). > > Spotted by smatch tool. > > Reported-by: Dan Carpenter <dan.carpen...@oracle.com> > Signed-off-by: Jiri Kosina <jkos...@suse.cz> Acked-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh

Re: [RFC PATCH v1.9 12/14] livepatch: create per-task consistency model

2016-04-05 Thread Josh Poimboeuf
On Wed, Apr 06, 2016 at 01:32:48AM +0800, Minfei Huang wrote: > On 03/25/16 at 02:34P, Josh Poimboeuf wrote: > > +static int klp_check_stack(struct task_struct *task) > > +{ > > + static unsigned long entries[MAX_STACK_ENTRIES]; > > + struct stack_trace trace; >

Re: [RFC PATCH v1.9 08/14] livepatch: separate enabled and patched states

2016-04-12 Thread Josh Poimboeuf
On Tue, Apr 12, 2016 at 09:44:43AM -0500, Chris J Arges wrote: > On Fri, Mar 25, 2016 at 02:34:55PM -0500, Josh Poimboeuf wrote: > > Once we have a consistency model, patches and their objects will be > > enabled and disabled at different times. For example, when a patch is &g

Re: [RFC PATCH v1.9 08/14] livepatch: separate enabled and patched states

2016-04-12 Thread Josh Poimboeuf
On Tue, Apr 12, 2016 at 12:35:49PM -0500, Chris J Arges wrote: > On Tue, Apr 12, 2016 at 12:16:00PM -0500, Josh Poimboeuf wrote: > > On Tue, Apr 12, 2016 at 09:44:43AM -0500, Chris J Arges wrote: > > > On Fri, Mar 25, 2016 at 02:34:55PM -0500, Josh Poimboeuf wrote: &g

This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations)

2016-04-12 Thread Josh Poimboeuf
On Thu, Feb 04, 2016 at 08:45:35PM +0100, Denys Vlasenko wrote: > Sometimes gcc mysteriously doesn't inline > very small functions we expect to be inlined. See > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122 > > With this .config: >

Re: This patch triggers a bad gcc bug (was Re: [PATCH] force inlining of some byteswap operations)

2016-04-13 Thread Josh Poimboeuf
On Wed, Apr 13, 2016 at 02:12:25PM +0200, Denys Vlasenko wrote: > On 04/13/2016 05:36 AM, Josh Poimboeuf wrote: > > On Thu, Feb 04, 2016 at 08:45:35PM +0100, Denys Vlasenko wrote: > >> Sometimes gcc mysteriously doesn't inline > >> very small functions we expect to be

Re: sched: horrible way to detect whether a task has been preempted

2016-04-08 Thread Josh Poimboeuf
On Fri, Apr 08, 2016 at 10:03:04AM +0200, Petr Mladek wrote: > On Fri 2016-04-08 09:05:28, Jiri Kosina wrote: > > On Thu, 7 Apr 2016, Jessica Yu wrote: > > > > > > Alternatively, without eating up a TIF_ space, it'd be possible to push > > > > a > > > > magic contents on top of the stack in

Re: [RFC PATCH v1.9 05/14] sched: horrible way to detect whether a task has been preempted

2016-04-08 Thread Josh Poimboeuf
On Fri, Apr 08, 2016 at 10:07:10AM +0200, Petr Mladek wrote: > On Thu 2016-04-07 09:34:03, Josh Poimboeuf wrote: > > On Thu, Apr 07, 2016 at 11:47:00AM +0200, Petr Mladek wrote: > > > On Wed 2016-04-06 11:33:56, Josh Poimboeuf wrote: > > > > On Wed, Apr 06, 2016 at

Re: [PATCH v2 6/8] tools rpmb: add RPBM access tool

2016-04-11 Thread Josh Poimboeuf
Hi Tomas, On Mon, Apr 04, 2016 at 02:11:22PM +0300, Tomas Winkler wrote: > Add simple RPMB host testing tool. It can be used > to program key, write and read data block, and retrieve > write counter. > > Signed-off-by: Tomas Winkler > --- > V2: resend > MAINTAINERS

Re: [RFC PATCH v1.9 07/14] x86/stacktrace: add function for detecting reliable stack traces

2016-04-12 Thread Josh Poimboeuf
On Mon, Apr 11, 2016 at 04:16:14PM +0200, Jiri Slaby wrote: > On 04/04/2016, 07:54 PM, Josh Poimboeuf wrote: > > On Thu, Mar 31, 2016 at 03:03:16PM +0200, Miroslav Benes wrote: > >> On Fri, 25 Mar 2016, Josh Poimboeuf wrote: > >> > >>> diff --git a/arch/x86

Re: [RFC PATCH v1.9 05/14] sched: horrible way to detect whether a task has been preempted

2016-04-06 Thread Josh Poimboeuf
On Wed, Apr 06, 2016 at 03:06:19PM +0200, Petr Mladek wrote: > On Fri 2016-03-25 14:34:52, Josh Poimboeuf wrote: > > This is a horrible way to detect whether a task has been preempted. > > Come up with something better: task flag? or is there already an > > existing mecha

[PATCH] livepatch: Update maintainers

2016-03-19 Thread Josh Poimboeuf
Seth and Vojtech are no longer active maintainers of livepatch, so remove them in favor of Jessica and Miroslav. Also add Petr as a designated reviewer. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- MAINTAINERS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

Re: Livepatch consistency model update

2016-03-21 Thread Josh Poimboeuf
On Mon, Mar 21, 2016 at 11:32:34PM +0100, Jiri Kosina wrote: > On Mon, 21 Mar 2016, Josh Poimboeuf wrote: > > > The objtool stack validation patches have been merged into Linus's tree > > for 4.6 with commit 26660a4046b1, and all known warnings are fixed. > > Yup, I'

Livepatch consistency model update

2016-03-21 Thread Josh Poimboeuf
Hi all, Just an update about the proposed consistency model, since several people have asked. The objtool stack validation patches have been merged into Linus's tree for 4.6 with commit 26660a4046b1, and all known warnings are fixed. So I'll be posting a revamped RFC of the hybrid consistency

Re: livepatch: reuse module loader code to write relocations

2016-03-21 Thread Josh Poimboeuf
On Mon, Mar 21, 2016 at 10:16:17PM +0100, Jiri Kosina wrote: > On Mon, 21 Mar 2016, Jessica Yu wrote: > > > Yes, this is a concern and I'm not sure what the best way to fix it > > is. If both MODULE_NAME_LEN and KSYM_NAME_LEN were straight up > > constants, then I think Josh's stringify approach

Re: module: preserve Elf information for livepatch modules

2016-03-22 Thread Josh Poimboeuf
On Tue, Mar 22, 2016 at 01:57:01PM -0400, Jessica Yu wrote: > +++ Josh Poimboeuf [21/03/16 09:06 -0500]: > >On Wed, Mar 16, 2016 at 03:47:04PM -0400, Jessica Yu wrote: > >>For livepatch modules, copy Elf section, symbol, and string information > >>from the load_info

Re: drivers/target/iscsi/iscsi_target.o: warning: objtool: iscsit_handle_task_mgt_cmd()+0xbcb: function has unreachable instruction

2016-03-23 Thread Josh Poimboeuf
On Wed, Mar 23, 2016 at 07:15:08PM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: a24e3d414e59ac76566dedcad1ed1d319a93ec14 > commit: d4883d5d6b146fd65f762c462b2c6d4a327c7d50 objtool: Enable stack > metadata

Re: drivers/target/iscsi/iscsi_target.o: warning: objtool: iscsit_handle_task_mgt_cmd()+0xbcb: function has unreachable instruction

2016-03-23 Thread Josh Poimboeuf
On Wed, Mar 23, 2016 at 04:11:04PM -0500, Josh Poimboeuf wrote: > On Wed, Mar 23, 2016 at 07:15:08PM +0800, kbuild test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: a24e3d414e59ac76566dedcad1ed1d

Re: [PATCH v5 2/6] module: preserve Elf information for livepatch modules

2016-03-21 Thread Josh Poimboeuf
On Wed, Mar 16, 2016 at 03:47:04PM -0400, Jessica Yu wrote: > For livepatch modules, copy Elf section, symbol, and string information > from the load_info struct in the module loader. Persist copies of the > original symbol table and string table. > > Livepatch manages its own relocation sections

Re: [PATCH v5 4/6] livepatch: reuse module loader code to write relocations

2016-03-21 Thread Josh Poimboeuf
On Mon, Mar 21, 2016 at 05:31:57PM +0100, Petr Mladek wrote: > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > index 780f00c..2aa20fa 100644 > > --- a/kernel/livepatch/core.c > > +++ b/kernel/livepatch/core.c > > +static int klp_resolve_symbols(Elf_Shdr *relasec, struct module

Re: [PATCH v5 4/6] livepatch: reuse module loader code to write relocations

2016-03-21 Thread Josh Poimboeuf
On Wed, Mar 16, 2016 at 03:47:06PM -0400, Jessica Yu wrote: > Reuse module loader code to write relocations, thereby eliminating the need > for architecture specific relocation code in livepatch. Specifically, reuse > the apply_relocate_add() function in the module loader to write relocations >

Re: [PATCH v5 5/6] samples: livepatch: mark as livepatch module

2016-03-21 Thread Josh Poimboeuf
On Wed, Mar 16, 2016 at 03:47:07PM -0400, Jessica Yu wrote: > Mark the module as a livepatch module so that the module loader can > appropriately identify and initialize it. > > Signed-off-by: Jessica Yu > --- > samples/livepatch/livepatch-sample.c | 1 + > 1 file changed, 1

Re: [PATCH] tools lib api: respect CROSS_COMPILE for the linker

2016-03-20 Thread Josh Poimboeuf
On Fri, Mar 18, 2016 at 01:25:47PM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Mar 17, 2016 at 06:27:50PM +0100, Lucas Stach escreveu: > > This fixes cross compilation of libapi. > > Humm, I guess that tools/lib/subcmd/Makefile has the same problem? And > there are also other cases where LD

Re: [PATCH v5 4/6] livepatch: reuse module loader code to write relocations

2016-03-21 Thread Josh Poimboeuf
On Mon, Mar 21, 2016 at 11:46:51AM -0500, Josh Poimboeuf wrote: > On Mon, Mar 21, 2016 at 05:31:57PM +0100, Petr Mladek wrote: > > > diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c > > > index 780f00c..2aa20fa 100644 > > > --- a/kernel/livepatch/core.

[RFC PATCH v1.9 03/14] x86/asm/head: standardize the bottom of the stack for idle tasks

2016-03-25 Thread Josh Poimboeuf
K set 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 <jpoim...@redhat.com> --- arch/x86/kernel/head_64.S | 8 +--- 1 file changed, 5 insertions(+), 3 deletions

[RFC PATCH v1.9 00/14] livepatch: hybrid consistency model

2016-03-25 Thread Josh Poimboeuf
_each_object/func helpers v1 was here: https://lkml.kernel.org/r/cover.1423499826.git.jpoim...@redhat.com Josh Poimboeuf (14): x86/asm/head: cleanup initial stack variable x86/asm/head: use a common function for starting CPUs x86/asm/head: standardize the bottom of the stack for idle tasks x86

[RFC PATCH v1.9 01/14] x86/asm/head: cleanup initial stack variable

2016-03-25 Thread Josh Poimboeuf
: - 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 <jpoim...@redhat.com> --- arch/x86/include/asm/realmode.h | 2 +- arch/x86/include/asm

[RFC PATCH v1.9 02/14] x86/asm/head: use a common function for starting CPUs

2016-03-25 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 <jpoim...@redhat.com> --- arch/x86/

[RFC PATCH v1.9 04/14] x86: move _stext marker before head code

2016-03-25 Thread Josh Poimboeuf
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 <jpoim...@redhat.com> --- arch/x86/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/

[RFC PATCH v1.9 12/14] livepatch: create per-task consistency model

2016-03-25 Thread Josh Poimboeuf
in the previous universe. A transition can be reversed and effectively canceled by writing the opposite value to the /sys/kernel/livepatch//enabled file while the transition is in progress. Then all the tasks will attempt to converge back to the original universe. Signed-off-by: Josh Poimboeuf <jp

[RFC PATCH v1.9 07/14] x86/stacktrace: add function for detecting reliable stack traces

2016-03-25 Thread Josh Poimboeuf
- corrupted stack data - newly forked tasks - running tasks - the user didn't provide a large enough entries array Also add a config option so arch-independent code can determine at build time whether the function is implemented. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/K

[RFC PATCH v1.9 10/14] livepatch: move patching functions into patch.c

2016-03-25 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 <jpoim...@redhat.com> --- kernel/livepatch/Makefile | 2 +- kernel/livepatch/core.c | 174 +-- kernel/livepatch/patch.c

[RFC PATCH v1.9 08/14] livepatch: separate enabled and patched states

2016-03-25 Thread Josh Poimboeuf
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 <jpoim...@redhat.com> --- include/linux/livepatch.h | 17 --- kernel/livepatch/core.c

[RFC PATCH v1.9 05/14] sched: horrible way to detect whether a task has been preempted

2016-03-25 Thread Josh Poimboeuf
This is a horrible way to detect whether a task has been preempted. Come up with something better: task flag? or is there already an existing mechanism? Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- include/linux/sched.h | 11 ++- kernel/sched/core.c

[RFC PATCH v1.9 09/14] livepatch: remove unnecessary object loaded check

2016-03-25 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 <jpoim...@redhat.com> --- kernel/livepatch/core.c | 3

[RFC PATCH v1.9 06/14] x86: add error handling to dump_trace()

2016-03-25 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 <jpoim...@redhat.com> --- arch/x86/include/asm/stacktrace.h | 36 +++--- arch/x86/

[RFC PATCH v1.9 13/14] livepatch: add /proc//patch_status

2016-03-25 Thread Josh Poimboeuf
Expose the per-task klp_universe value so users can determine which tasks are holding up completion of a patching operation. Call it "patch_status" rather than "universe": it's at least more descriptive for the average user. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.c

[RFC PATCH v1.9 14/14] livepatch: update task universe when exiting kernel

2016-03-25 Thread Josh Poimboeuf
switch universes when returning from an interrupt. If a task is sleeping on a to-be-patched function, the user can send SIGSTOP and SIGCONT to force it to switch. Since the idle "swapper" tasks don't ever exit the kernel, they're updated from within the idle loop. Signed-off-by: Josh

[RFC PATCH v1.9 11/14] livepatch: store function sizes

2016-03-25 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 stacks of any tasks. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- include/linux/livepatch.h | 3 +++ kernel/livepatch/core.c | 16 2 files chang

Re: [PATCH v6 0/5] (mostly) Arch-independent livepatch

2016-03-23 Thread Josh Poimboeuf
tion, as sscanf() takes care to put a null byte at the end of >the bufs. > - Fix compiler kbuild errors for the !CONFIG_LIVEPATCH case > - Fixed some small module.c nits For the series: Acked-by: Josh Poimboeuf <jpoim...@redhat.com> Thanks Jessica! -- Josh

Re: [PATCH] tools lib api: respect CROSS_COMPILE for the linker

2016-03-19 Thread Josh Poimboeuf
On Fri, Mar 18, 2016 at 02:38:52PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Mar 18, 2016 at 12:16:23PM -0500, Josh Poimboeuf escreveu: > > On Fri, Mar 18, 2016 at 01:45:22PM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Fri, Mar 18, 2016 at 11:38:15AM -0500, Josh

Re: [PATCH v19 00/10] Compile-time stack metadata validation

2016-03-08 Thread Josh Poimboeuf
On Tue, Mar 08, 2016 at 11:37:16AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > This is v19 of the compile-time stack metadata validation patch set. > > > > It's based on tip:core/objtool. > > So I've upgraded my main

Re: [PATCH v19 00/10] Compile-time stack metadata validation

2016-03-08 Thread Josh Poimboeuf
On Tue, Mar 08, 2016 at 02:44:57PM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > On Tue, Mar 08, 2016 at 11:37:16AM +0100, Ingo Molnar wrote: > > > > > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > &g

Re: [PATCH] klp: remove superfluous errors in asm/livepatch.h

2016-03-04 Thread Josh Poimboeuf
On Fri, Mar 04, 2016 at 10:53:39AM +0100, Miroslav Benes wrote: > There is an #error in asm/livepatch.h for both x86 and s390 in > !CONFIG_LIVEPATCH cases. It does not make much sense as pointed out by > Michael Ellerman. One can happily include asm/livepatch.h with > CONFIG_LIVEPATCH. Remove it

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

Re: [PATCH] klp: remove superfluous errors in asm/livepatch.h

2016-03-06 Thread Josh Poimboeuf
On Sun, Mar 06, 2016 at 10:13:56PM +0100, Jiri Kosina wrote: > On Fri, 4 Mar 2016, Josh Poimboeuf wrote: > > > > There is an #error in asm/livepatch.h for both x86 and s390 in > > > !CONFIG_LIVEPATCH cases. It does not make much sense as pointed out by > > >

Re: [PATCH] objtool: Disable stack validation when CROSS_COMPILE is used

2016-03-02 Thread Josh Poimboeuf
On Wed, Mar 02, 2016 at 01:27:35PM +1100, Stephen Rothwell wrote: > Hi Josh, > > On Tue, 1 Mar 2016 15:54:51 -0600 Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > > Changing it to use the host compiler would probably be an easy fix, but > > that would expose a

[PATCH 0/2] objtool: Cross-compilation support

2016-03-02 Thread Josh Poimboeuf
This adds the ability for CONFIG_STACK_VALIDATION to work in a cross-compiled environment against an x86 kernel. Based on tip/master. Josh Poimboeuf (2): x86/asm/decoder: Use explicitly signed chars objtool: Support CROSS_COMPILE arch/x86/lib/insn.c | 6 +++--- tools

[PATCH 1/2] x86/asm/decoder: Use explicitly signed chars

2016-03-02 Thread Josh Poimboeuf
h are all kept in sync via makefile checks and warnings: in-kernel, perf, and objtool. This fixes all three locations. Eventually we should probably try to at least converge the two separate "tools" locations into a single shared location. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com

[PATCH 2/2] objtool: Support CROSS_COMPILE

2016-03-02 Thread Josh Poimboeuf
endian system would result in a bunch of false positive objtool warnings during the kernel build because it isn't endian-aware. But that's generally a rare edge case and there haven't been any reports of anybody needing that. Reported-by: Stephen Rothwell <s...@canb.auug.org.au> Signed-off-by

Re: [PATCH 2/2] objtool: Support CROSS_COMPILE

2016-03-02 Thread Josh Poimboeuf
On Thu, Mar 03, 2016 at 01:43:14PM +1100, Stephen Rothwell wrote: > Hi Josh, > > Just a couple of quick comments ... > > On Wed, 2 Mar 2016 18:39:37 -0600 Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > > diff --git a/tools/objtool/Makefile b/tools/objtool/Ma

Re: [PATCH 2/2] objtool: Support CROSS_COMPILE

2016-03-02 Thread Josh Poimboeuf
On Thu, Mar 03, 2016 at 02:38:43PM +1100, Stephen Rothwell wrote: > Hi Josh, > > On Wed, 2 Mar 2016 21:20:58 -0600 Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > > On Thu, Mar 03, 2016 at 01:43:14PM +1100, Stephen Rothwell wrote: > > > > > > I wa

[PATCH] objtool: Warn if libelf is missing

2016-03-03 Thread Josh Poimboeuf
and disable stack validation. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- Based on tip/master. Makefile | 13 - scripts/Makefile.build | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 750df29..1fd8328

[PATCH] tools: Support relative directory path for 'O='

2016-03-03 Thread Josh Poimboeuf
ld objtool in tools/foo. Convert the output directory to an absolute path before passing it to the tools Makefile. Reported-by: Sudip Mukherjee <sudipm.mukher...@gmail.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 de

Re: linux-next: Tree for Mar 3

2016-03-03 Thread Josh Poimboeuf
ve ever done. :) > bisect shows the first bad commit as: > d4883d5d6b14 ("objtool: Enable stack metadata validation on 64-bit x86") > > After reverting it the issue I am facing is fixed. > > Adding Cc to: Josh Poimboeuf, Ingo Molnar and Andrew Morton Hi Sudip, It looks like setting 'O=' with a relative path is broken. I'll have a patch to fix it shortly. I'll also try to improve the error message for when libelf-dev isn't installed. -- Josh

Re: [tip:core/objtool] objtool: Add CONFIG_STACK_VALIDATION option

2016-03-03 Thread Josh Poimboeuf
On Thu, Mar 03, 2016 at 03:12:01PM +0100, Sebastian Andrzej Siewior wrote: > On 2016-02-29 03:01:35 [-0800], tip-bot for Josh Poimboeuf wrote: > > Gitweb: > > http://git.kernel.org/tip/b9ab5ebb14ec389bd80f66613f1fe3f8f65f2521 > > Author: Josh Poimboeuf <jpoim...

[PATCH] rtc: ds1685: actually spin forever in poweroff error path

2016-03-07 Thread Josh Poimboeuf
ed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- drivers/rtc/rtc-ds1685.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index 08e0ff8..1e6cfc8 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -21

Re: [PATCH] rtc: ds1685: actually spin forever in poweroff error path

2016-03-07 Thread Josh Poimboeuf
On Mon, Mar 07, 2016 at 04:30:50PM -0500, Joshua Kinard wrote: > On 03/07/2016 10:03, Josh Poimboeuf wrote: > > objtool reports the following warnings: > > > > drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x0: > > duplicate frame pointer save &

<    5   6   7   8   9   10   11   12   13   14   >