Re: [PATCH v14 00/11] livepatch: Atomic replace feature

2018-12-06 Thread Joe Lawrence
On 12/06/2018 07:37 AM, Petr Mladek wrote: > On Thu 2018-12-06 11:15:55, Petr Mladek wrote: >> On Thu 2018-12-06 10:32:00, Miroslav Benes wrote: >>> > I don't have many code comments as the changes appear to safely and > correctly do what the say. (We are at v14 after all :) I mainly

Re: [PATCH v14 05/11] livepatch: Simplify API by removing registration step

2018-12-06 Thread Joe Lawrence
On 12/06/2018 05:14 AM, Petr Mladek wrote: > On Thu 2018-12-06 10:23:40, Miroslav Benes wrote: >> On Thu, 6 Dec 2018, Petr Mladek wrote: >> >>> On Wed 2018-12-05 14:32:53, Joe Lawrence wrote: >>>>> diff --git a/kernel/livepatch/core.c b/kernel/li

double clock sched_features warnings msgs

2018-08-14 Thread Joe Lawrence
Hi Peter, A QA tester here has noticed that he can regularly provoke a "rq->clock_update_flags & RQCF_UPDATED" warning when echo'ing into the debugfs sched_features file: % echo WARN_DOUBLE_CLOCK > /sys/kernel/debug/sched_features ... [ cut here ] rq->clock_update_flags

Re: [PATCH v13 12/12] selftests/livepatch: introduce tests

2018-10-15 Thread Joe Lawrence
On 10/15/2018 08:37 AM, Petr Mladek wrote: > From: Joe Lawrence > > Add a few livepatch modules and simple target modules that the included > regression suite can run tests against: > > - basic livepatching (multiple patches, atomic replace) > - pre/post (un)patch c

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-16 Thread Joe Lawrence
On 4/16/19 1:24 AM, Balbir Singh wrote: Could we get some details with examples or a sample, sorry I might be dense and missing simple information. The problem being solved is not clear to me from the changelog. Hi Balbir, I see that Miroslav has already pointed to documentation, samples

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-16 Thread Joe Lawrence
On 4/10/19 11:50 AM, Joe Lawrence wrote: Hi folks, This is the third installment of the klp-convert tool for generating and processing livepatch symbols for livepatch module builds. For those following along at home, archive links to previous versions: RFC: https://lore.kernel.org/lkml

Re: [PATCH v3 2/9] kbuild: Support for Symbols.list creation

2019-04-16 Thread Joe Lawrence
On 4/11/19 3:04 PM, Miroslav Benes wrote: diff --git a/samples/livepatch/Makefile b/samples/livepatch/Makefile index 2472ce39a18d..8b9b42a258ad 100644 --- a/samples/livepatch/Makefile +++ b/samples/livepatch/Makefile @@ -1,3 +1,4 @@ +LIVEPATCH_livepatch-sample := y

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-17 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:49AM -0400, Joe Lawrence wrote: > > [ ... snip ... ] > > TODO > > > There are a few outstanding items that I came across while reviewing v2, > but as changes started accumulating, it made sense to defer those to a > later version.

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-24 Thread Joe Lawrence
On 4/24/19 3:13 PM, Joao Moreira wrote: Future Work --- I don't see an easy way to support multiple homonym symbols with unique values in the current livepatch module Elf format. The only solutions that come to mind right now include renaming homonym symbols somehow to retain the

Re: [PATCH v3 3/9] livepatch: Add klp-convert tool

2019-04-24 Thread Joe Lawrence
On 4/24/19 1:47 PM, Miroslav Benes wrote: On Tue, 23 Apr 2019, Joe Lawrence wrote: diff --git a/scripts/livepatch/klp-convert.c b/scripts/livepatch/klp-convert.c index 82c27d219372..126395f1c0cd 100644 --- a/scripts/livepatch/klp-convert.c +++ b/scripts/livepatch/klp-convert.c @@ -517,6 +517,7

Re: Livepatch vs LTO

2019-04-25 Thread Joe Lawrence
On 4/25/19 11:26 AM, Josh Poimboeuf wrote: Hi all, On IRC, Peter expressed some concern about -flive-patching, specifically that the flag isn't compatible with LTO. The upstream kernel currently doesn't support LTO, but Android is using it with LLVM:

Re: [PATCH] livepatch: Remove stale kobj_added entries from kernel-doc descriptions

2019-05-07 Thread Joe Lawrence
@free_work:patch cleanup from workqueue-context D'oh, missed that in the review. Good eye, Kamalesh. Acked-by: Joe Lawrence -- Joe

[PATCH v4 06/10] modpost: Add modinfo flag to livepatch modules

2019-05-09 Thread Joe Lawrence
and store it in (MODVERDIR)/livepatchmods. Give this list as an argument for modpost which will use it to identify livepatch modules. As MODULE_INFO is no longer needed, remove it. Signed-off-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- lib/livepatch/test_klp_atomic

[PATCH v4 01/10] livepatch: Create and include UAPI headers

2019-05-09 Thread Joe Lawrence
Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS| 1 + include/linux/livepatch.h | 1 + include/uapi/linux/livepatch.h | 15 +++ kernel/livepatch/core.c| 4 ++-- 4 files changed, 19 insertions(+), 2 deletions(-) create

[PATCH v4 00/10] klp-convert livepatch build tooling

2019-05-09 Thread Joe Lawrence
to github: 1 - an expanded branch with changes separate from the original https://github.com/joe-lawrence/linux/tree/klp-convert-v4-expanded 2 - a squashed branch of (1) that comprises v4: https://github.com/joe-lawrence/linux/tree/klp-convert-v4 Non-trivial commits in the expanded branch have

[PATCH v4 02/10] kbuild: Support for Symbols.list creation

2019-05-09 Thread Joe Lawrence
was originally proposed by Miroslav Benes as a workaround for identifying livepathes without depending on modinfo during the modpost stage. It was moved to this patch as the approach also shown to be useful while building Symbols.list. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence

[PATCH v4 08/10] documentation: Update on livepatch elf format

2019-05-09 Thread Joe Lawrence
From: Joao Moreira Add a section to Documentation/livepatch/module-elf-format.txt describing how klp-convert works for fixing relocations. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- Documentation/livepatch/livepatch.txt | 3 ++ Documentation/livepatch/module-elf

[PATCH v4 10/10] livepatch/klp-convert: abort on special sections

2019-05-09 Thread Joe Lawrence
r this (ie, moving data structure entries and relocations to their ".klp.arch" equivalents) but the hardest part will be determining klp_object relationships. This may require some larger changes to livepatch API, so defer support for now. Signed-off-by: Joe Lawrence --- scripts/livepatc

[PATCH v4 09/10] livepatch/selftests: add klp-convert

2019-05-09 Thread Joe Lawrence
Add a simple klp-convert livepatch selftest that exercises various symbol homonym sympos scenarios. Signed-off-by: Joe Lawrence --- lib/livepatch/Makefile| 10 ++ lib/livepatch/test_klp_convert1.c | 106 ++ lib/livepatch/test_klp_convert2.c

[PATCH v4 07/10] livepatch: Add sample livepatch module

2019-05-09 Thread Joe Lawrence
sample updates the function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Update livepatch-sample.c to remove livepatch MODULE_INFO statement. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-o

[PATCH v4 05/10] modpost: Integrate klp-convert

2019-05-09 Thread Joe Lawrence
-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- scripts/Kbuild.include | 4 +++- scripts/Makefile.modpost | 16 +++- scripts/mod/modpost.c| 6 +- scripts/mod/modpost.h| 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git

[PATCH v4 04/10] livepatch: Add klp-convert annotation helpers

2019-05-09 Thread Joe Lawrence
From: Josh Poimboeuf Define macros KLP_MODULE_RELOC and KLP_SYMPOS in include/linux/livepatch.h to improve user-friendliness of the livepatch annotation process. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- include/linux/livepatch.h | 12

[PATCH v4 03/10] livepatch: Add klp-convert tool

2019-05-09 Thread Joe Lawrence
Signed-off-by: Konstantin Khlebnikov Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS | 1 + include/uapi/linux/livepatch.h | 5 + scripts/Makefile| 1 + scripts/livepatch/.gitignore| 1 + scripts/livepatch/Makefile

Re: [PATCH v3 3/9] livepatch: Add klp-convert tool

2019-04-23 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:52AM -0400, Joe Lawrence wrote: > > [ ... snip ... ] > > +static bool convert_rela(struct section *oldsec, struct rela *r, > + struct sympos *sp, struct elf *klp_elf) > +{ > + struct section *sec; > + struct rela *

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-05-03 Thread Joe Lawrence
On Tue, Apr 16, 2019 at 01:37:13PM +0200, Miroslav Benes wrote: > > [ ... snip ... ] > > Quick look, but it seems quite similar to the problem we had with > apply_alternatives(). See arch/x86/kernel/livepatch.c and the commit which > introduced it. That was an interesting diversion :) I think I

Re: [PATCH 0/2] livepatch: Remove custom kobject state handling and duplicated code

2019-05-03 Thread Joe Lawrence
atch: Remove custom kobject state handling > livepatch: Remove duplicated code for early initialization > > include/linux/livepatch.h | 3 -- > kernel/livepatch/core.c | 86 > --- > 2 files changed, 37 insertions(+), 52 deletions(-) &

Re: livepatching selftests failure on current master branch

2019-05-17 Thread Joe Lawrence
On 5/17/19 10:17 AM, Miroslav Benes wrote: Hi, I noticed that livepatching selftests fail on our master branch (https://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git/). ... TEST: busy target module ... not ok --- expected +++ result @@ -7,16 +7,24 @@ livepatch:

[PATCH] stacktrace: fix CONFIG_ARCH_STACKWALK stack_trace_save_tsk_reliable return

2019-05-17 Thread Joe Lawrence
trace retrieval") Reported-by: Miroslav Benes Signed-off-by: Joe Lawrence --- kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c index 27bafc1e271e..90d3e0bf0302 100644 --- a/kernel/stacktrace.c +++

Re: [PATCH] stacktrace: fix CONFIG_ARCH_STACKWALK stack_trace_save_tsk_reliable return

2019-05-17 Thread Joe Lawrence
On Fri, May 17, 2019 at 02:51:17PM -0400, Joe Lawrence wrote: > Miroslav reported that the livepatch self-tests were failing, > specifically a case in which the consistency model ensures that we do > not patch a current executing function, "TEST: busy target module". >

Re: [PATCH v2 0/8] klp-convert

2019-03-18 Thread Joe Lawrence
ally spent last week reviewing and testing. My goal was to write a klp self-test based on the implementation and your sample module. Along the way I spotted a few minor bugs and other small suggestions. Instead of dumping a bunch of code or patch content in my replies, I posted my rebase and modi

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:07AM -0300, Joao Moreira wrote: > For automatic resolution of livepatch relocations, a file called > Symbols.list is used. This file maps symbols within every compiled > kernel object allowing the identification of symbols whose name is > unique, thus relocation can

Re: [PATCH v2 3/8] livepatch: Add klp-convert tool

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:08AM -0300, Joao Moreira wrote: > From: Josh Poimboeuf > > Livepatches may use symbols which are not contained in its own scope, > and, because of that, may end up compiled with relocations that will > only be resolved during module load. Yet, when the referenced

Re: [PATCH v2 5/8] modpost: Integrate klp-convert

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:10AM -0300, Joao Moreira wrote: > From: Josh Poimboeuf > > Create cmd_klp_convert and hook it into scripts/Makefile.modpost. > cmd_klp_convert invokes klp-convert with the right arguments for the > conversion of unresolved symbols inside a livepatch. > >

Re: [PATCH v2 6/8] modpost: Add modinfo flag to livepatch modules

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:11AM -0300, Joao Moreira wrote: > From: Miroslav Benes > > Currently, livepatch infrastructure in the kernel relies on > MODULE_INFO(livepatch, "Y") statement in a livepatch module. Then the > kernel module loader knows a module is indeed livepatch module and can >

Re: [PATCH v2 7/8] livepatch: Add sample livepatch module

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:12AM -0300, Joao Moreira wrote: > From: Josh Poimboeuf > > Add a new livepatch sample in samples/livepatch/ to make use of > symbols that must be post-processed to enable load-time relocation > resolution. As the new sample is to be used as an example, it is >

Re: [PATCH v2 8/8] documentation: Update on livepatch elf format

2019-03-18 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:13AM -0300, Joao Moreira wrote: > Add a section to Documentation/livepatch/module-elf-format.txt > describing how klp-convert works for fixing relocations. > > Signed-off-by: Joao Moreira > --- > Documentation/livepatch/module-elf-format.txt | 47 >

Re: tools bugs: make clean deletes files in the git tree

2019-03-26 Thread Joe Lawrence
On 3/26/19 4:45 AM, Adrian Hunter wrote: Hi Doing: make -C tools clean Results in: git diff --stat tools/pci/pcitest.sh | 72 tools/testing/selftests/livepatch/test-callbacks.sh | 587

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-03-26 Thread Joe Lawrence
On 3/26/19 10:40 AM, Joao Moreira wrote: On 3/20/19 4:08 PM, Miroslav Benes wrote: diff --git a/scripts/Makefile.build b/scripts/Makefile.build index fd03d60f6c5a..1e28ad21314c 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -247,6 +247,11 @@ cmd_gen_ksymdeps = \

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-03-26 Thread Joe Lawrence
On 3/26/19 2:13 PM, Joao Moreira wrote: On 3/26/19 1:15 PM, Joe Lawrence wrote: >> Hi Joao, This change seems to work okay for (again) single object modules, but I'm having issues with multi-object modules. Hi Joe, thanks for the sources, this made everything much easier in m

Re: [PATCH v2 0/8] klp-convert

2019-03-26 Thread Joe Lawrence
On 3/26/19 4:18 PM, Joao Moreira wrote: On 3/18/19 4:18 PM, Joe Lawrence wrote: On Fri, Mar 01, 2019 at 11:13:05AM -0300, Joao Moreira wrote: Livepatches may use symbols which are not contained in its own scope, and, because of that, may end up compiled with relocations that will only

[PATCH] x86/stacktrace: export save_stack_trace_tsk_reliable

2019-02-27 Thread Joe Lawrence
The ppc64le implementation of save_stack_trace_tsk_reliable() is exported, so do the same with x86. Signed-off-by: Joe Lawrence --- arch/x86/kernel/stacktrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 5c2d71a1dc06

Re: [PATCH] x86/stacktrace: export save_stack_trace_tsk_reliable

2019-02-27 Thread Joe Lawrence
On 2/27/19 4:31 PM, Thomas Gleixner wrote: On Wed, 27 Feb 2019, Joe Lawrence wrote: The ppc64le implementation of save_stack_trace_tsk_reliable() is exported, so do the same with x86. And what's the in tree module user of this? I can't find one and just because PPC has an export with no user

Re: [PATCH] x86/stacktrace: export save_stack_trace_tsk_reliable

2019-02-27 Thread Joe Lawrence
On 2/27/19 5:25 PM, Joe Lawrence wrote: On 2/27/19 4:31 PM, Thomas Gleixner wrote: On Wed, 27 Feb 2019, Joe Lawrence wrote: The ppc64le implementation of save_stack_trace_tsk_reliable() is exported, so do the same with x86. And what's the in tree module user of this? I can't find one

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-04-01 Thread Joe Lawrence
On Thu, Mar 28, 2019 at 04:17:03PM -0400, Joe Lawrence wrote: > On Tue, Mar 26, 2019 at 04:53:12PM -0400, Joe Lawrence wrote: > > On 3/26/19 2:13 PM, Joao Moreira wrote: > > > > > > > > > On 3/26/19 1:15 PM, Joe Lawrence wrote: > > >> > > >

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-04-03 Thread Joe Lawrence
On 4/3/19 8:48 AM, Miroslav Benes wrote: > >> and it looks like the combined KLP_MODULE_RELOC still contains the two >> unique symbol position values (2 and 3): >> >>% objcopy -O binary --only-section=.klp.module_relocs.vmlinux >> lib/livepatch/test_klp_convert.klp.o >(hexdump -C) >>

[PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-10 Thread Joe Lawrence
up to github: 1 - an expanded branch that with changes separate from the original https://github.com/joe-lawrence/linux/commits/klp-convert-v3-expanded 2 - a squashed branch of (1) that comprises v3: https://github.com/joe-lawrence/linux/commits/klp-convert-v3 Non-trivial commits

[PATCH v3 7/9] livepatch: Add sample livepatch module

2019-04-10 Thread Joe Lawrence
sample updates the function cmdline_proc_show to print the string referenced by the symbol saved_command_line appended by the string "livepatch=1". Update livepatch-sample.c to remove livepatch MODULE_INFO statement. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-o

[PATCH v3 9/9] livepatch/selftests: add klp-convert

2019-04-10 Thread Joe Lawrence
Add a simple klp-convert livepatch selftest that exercises various symbol homonym sympos scenarios. Signed-off-by: Joe Lawrence --- lib/livepatch/Makefile| 10 ++ lib/livepatch/test_klp_convert1.c | 106 ++ lib/livepatch/test_klp_convert2.c

[PATCH v3 8/9] documentation: Update on livepatch elf format

2019-04-10 Thread Joe Lawrence
From: Joao Moreira Add a section to Documentation/livepatch/module-elf-format.txt describing how klp-convert works for fixing relocations. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- Documentation/livepatch/livepatch.txt | 3 ++ Documentation/livepatch/module-elf

[PATCH v3 5/9] modpost: Integrate klp-convert

2019-04-10 Thread Joe Lawrence
-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- scripts/Kbuild.include | 4 +++- scripts/Makefile.modpost | 16 +++- scripts/mod/modpost.c| 6 +- scripts/mod/modpost.h| 1 + 4 files changed, 24 insertions(+), 3 deletions(-) diff --git

[PATCH v3 6/9] modpost: Add modinfo flag to livepatch modules

2019-04-10 Thread Joe Lawrence
and store it in (MODVERDIR)/livepatchmods. Give this list as an argument for modpost which will use it to identify livepatch modules. As MODULE_INFO is no longer needed, remove it. Signed-off-by: Miroslav Benes Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- lib/livepatc

[PATCH v3 4/9] livepatch: Add klp-convert annotation helpers

2019-04-10 Thread Joe Lawrence
From: Josh Poimboeuf Define macros KLP_MODULE_RELOC and KLP_SYMPOS in include/linux/livepatch.h to improve user-friendliness of the livepatch annotation process. Signed-off-by: Josh Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- include/linux/livepatch.h | 12

[PATCH v3 3/9] livepatch: Add klp-convert tool

2019-04-10 Thread Joe Lawrence
Signed-off-by: Konstantin Khlebnikov Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS | 1 + include/uapi/linux/livepatch.h | 5 + scripts/Makefile| 1 + scripts/livepatch/.gitignore| 1 + scripts/livepatch/Makefile

[PATCH v3 1/9] livepatch: Create and include UAPI headers

2019-04-10 Thread Joe Lawrence
Poimboeuf Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence --- MAINTAINERS| 1 + include/linux/livepatch.h | 1 + include/uapi/linux/livepatch.h | 17 + kernel/livepatch/core.c| 4 ++-- 4 files changed, 21 insertions(+), 2 deletions(-) create

[PATCH v3 2/9] kbuild: Support for Symbols.list creation

2019-04-10 Thread Joe Lawrence
was originally proposed by Miroslav Benes as a workaround for identifying livepathes without depending on modinfo during the modpost stage. It was moved to this patch as the approach also shown to be useful while building Symbols.list. Signed-off-by: Joao Moreira Signed-off-by: Joe Lawrence

Re: [PATCH v3 4/9] livepatch: Add klp-convert annotation helpers

2019-04-10 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:53AM -0400, Joe Lawrence wrote: > From: Josh Poimboeuf > > Define macros KLP_MODULE_RELOC and KLP_SYMPOS in > include/linux/livepatch.h to improve user-friendliness of the > livepatch annotation process. > > Signed-off-by: Josh Poimboeuf

Re: [PATCH v3 3/9] livepatch: Add klp-convert tool

2019-04-10 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:52AM -0400, Joe Lawrence wrote: > > [ ... snip ... ] > > diff --git a/scripts/livepatch/klp-convert.c b/scripts/livepatch/klp-convert.c > new file mode 100644 > index ..62bd26941081 > --- /dev/null > +++ b/scripts/livepatch/klp-c

Re: [PATCH v3 1/9] livepatch: Create and include UAPI headers

2019-04-11 Thread Joe Lawrence
On 4/10/19 8:32 PM, Masahiro Yamada wrote: On Thu, Apr 11, 2019 at 12:52 AM Joe Lawrence wrote: From: Josh Poimboeuf Define klp prefixes in include/uapi/linux/livepatch.h, and use them for replacing hard-coded values in kernel/livepatch/core.c. [ ... snip ... ] >> diff --git a/i

Re: [PATCH v3 2/9] kbuild: Support for Symbols.list creation

2019-04-11 Thread Joe Lawrence
On 4/11/19 5:18 AM, Artem Savkov wrote: On Wed, Apr 10, 2019 at 11:50:51AM -0400, Joe Lawrence wrote: -clean: archclean vmlinuxclean +klpclean: + $(Q) rm -f $(objtree)/Symbols.list nit: $(SLIST) can be used here. +clean: archclean vmlinuxclean klpclean # mrproper - Delete all

Re: [PATCH v3 5/9] modpost: Integrate klp-convert

2019-04-11 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:54AM -0400, Joe Lawrence wrote: > > [ ... snip ... ] > > diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost > index 6b7f354f189a..1e8bb7442689 100644 > --- a/scripts/Makefile.modpost > +++ b/scripts/Makefile.modpos

Re: [PATCH v2 0/8] klp-convert

2019-04-04 Thread Joe Lawrence
On 4/4/19 7:49 AM, Miroslav Benes wrote: BTW, something I *just* noticed when putting together that toy out-of-tree module to test out multi-object livepatch modules is that we aren't considering out-of-tree symbols in Symbols.list. Perhaps we can save that for v4 or beyond, but maybe we

Re: [PATCH v2 2/8] kbuild: Support for Symbols.list creation

2019-03-28 Thread Joe Lawrence
On Tue, Mar 26, 2019 at 04:53:12PM -0400, Joe Lawrence wrote: > On 3/26/19 2:13 PM, Joao Moreira wrote: > > > > > > On 3/26/19 1:15 PM, Joe Lawrence wrote: > >> > > > Hi Joao, > > > > > > This change seems to work okay for (again) sing

Re: [PATCH] selftests: livepatch use TEST_PROGS for test shell scripts

2019-04-12 Thread Joe Lawrence
On 4/12/19 1:05 PM, shuah wrote: On 4/12/19 7:37 AM, Miroslav Benes wrote: On Fri, 12 Apr 2019, shuah wrote: On 4/12/19 1:03 AM, Miroslav Benes wrote: On Thu, 11 Apr 2019, Shuah Khan wrote: TEST_PROGS variable is for test shell scripts and common clean target in lib.mk doesn't touch them.

Re: [PATCH v3 0/9] klp-convert livepatch build tooling

2019-04-12 Thread Joe Lawrence
On Wed, Apr 10, 2019 at 11:50:49AM -0400, Joe Lawrence wrote: > Hi folks, > > This is the third installment of the klp-convert tool for generating and > processing livepatch symbols for livepatch module builds. For those > following along at home, archive links to previous ver

Re: [PATCH v2 5/8] modpost: Integrate klp-convert

2019-03-22 Thread Joe Lawrence
On Fri, Mar 01, 2019 at 11:13:10AM -0300, Joao Moreira wrote: > From: Josh Poimboeuf > > Create cmd_klp_convert and hook it into scripts/Makefile.modpost. > cmd_klp_convert invokes klp-convert with the right arguments for the > conversion of unresolved symbols inside a livepatch. > >

Re: [PATCH v2 5/8] modpost: Integrate klp-convert

2019-03-22 Thread Joe Lawrence
On 3/22/19 12:37 PM, Joao Moreira wrote: On 2019-03-22 11:54, Joe Lawrence wrote: On Fri, Mar 01, 2019 at 11:13:10AM -0300, Joao Moreira wrote: From: Josh Poimboeuf Create cmd_klp_convert and hook it into scripts/Makefile.modpost. cmd_klp_convert invokes klp-convert with the right arguments

Re: [PATCH 0/4] livepatch: Followup changes for the atomic replace patchset

2019-02-01 Thread Joe Lawrence
t;8-- -->8-- -->8-- -->8-- -->8-- -->8-- >From e4c1e95a2145405115a984c6567740d12f20ccb7 Mon Sep 17 00:00:00 2001 From: Joe Lawrence Date: Fri, 1 Feb 2019 10:53:25 -0500 Subject: [PATCH] livepatch: return -ENOMEM on ptr_id() allocation failure Fixes the following smatch warning

Re: [PATCH] sched/debug: initialize sd_sysctl_cpus if !CONFIG_CPUMASK_OFFSTACK

2019-02-01 Thread Joe Lawrence
On 1/31/19 8:44 AM, Masayoshi Mizuma wrote: On Wed, Jan 30, 2019 at 09:14:00PM +0100, Peter Zijlstra wrote: On Tue, Jan 29, 2019 at 10:12:45AM -0500, Masayoshi Mizuma wrote: From: Hidetoshi Seto register_sched_domain_sysctl() copies the cpu_possible_mask into sd_sysctl_cpus, but only if

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

2019-01-22 Thread Joe Lawrence
://lore.kernel.org/lkml/7f468285-b149-37e2-e782-c9e538b99...@redhat.com/ Joe Lawrence (3): powerpc/livepatch: relax reliable stack tracer checks for first-frame powerpc/livepatch: small cleanups in save_stack_trace_tsk_reliable() powerpc/livepatch: return -ERRNO values

[PATCH 3/4] powerpc/livepatch: small cleanups in save_stack_trace_tsk_reliable()

2019-01-22 Thread Joe Lawrence
Mostly cosmetic changes: - Group common stack pointer code at the top - Simplify the first frame logic - Code stackframe iteration into for...loop construct - Check for trace->nr_entries overflow before adding any into the array Suggested-by: Nicolai Stange Signed-off-by: Joe Lawre

[PATCH 1/4] powerpc/64s: Clear on-stack exception marker upon exception return

2019-01-22 Thread Joe Lawrence
RKER magic, as written by exception prologues, is found at a particular location. However, as observed by Joe Lawrence, it is possible in practice that non-exception stack frames can alias with prior exception frames and thus, that the reliable stacktracer can find a stale STACK_FRAME_R

[PATCH 2/4] powerpc/livepatch: relax reliable stack tracer checks for first-frame

2019-01-22 Thread Joe Lawrence
ME_LR_SAVE and STACK_FRAME_MARKER offsets that may contain uninitialized residual data. Fixes: df78d3f61480 ("powerpc/livepatch: Implement reliable stack tracing for the consistency model") Signed-off-by: Joe Lawrence --- arch/powerpc/kernel/stacktrace.c | 32

[PATCH 4/4] powerpc/livepatch: return -ERRNO values in save_stack_trace_tsk_reliable()

2019-01-22 Thread Joe Lawrence
To match its x86 counterpart, save_stack_trace_tsk_reliable() should return -EINVAL in cases that it is currently returning 1. No caller is currently differentiating non-zero error codes, but let's keep the arch-specific implementations consistent. Signed-off-by: Joe Lawrence --- arch/powerpc

Re: [PATCH V2] livepatch: fix non-static warnings

2019-01-22 Thread Joe Lawrence
On 12/18/18 10:18 AM, Joe Lawrence wrote: On 12/18/2018 03:49 AM, Miroslav Benes wrote: On Mon, 17 Dec 2018, Joe Lawrence wrote: I'm just being picky about its documentation and how we should note its usage in the v3 patch. Think that s/__noclone/used/g of the v2 commit message would

Re: [PATCH 4/4] livepatch: Remove the redundant enabled flag in struct klp_patch

2019-01-23 Thread Joe Lawrence
On 1/22/19 5:06 AM, Miroslav Benes wrote: On Wed, 16 Jan 2019, Petr Mladek wrote: diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 684766d306ad..8e644837e668 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -59,6 +59,17 @@ static bool

Re: [PATCH 1/4] livepatch: Introduce klp_for_each_patch macro

2019-01-21 Thread Joe Lawrence
el/livepatch/transition.c b/kernel/livepatch/transition.c > index 300273819674..a3a6f32c6fd0 100644 > --- a/kernel/livepatch/transition.c > +++ b/kernel/livepatch/transition.c > @@ -642,6 +642,6 @@ void klp_force_transition(void) > for_each_possible_cpu(cpu) > klp_update_patch_state(idle_task(cpu)); > > - list_for_each_entry(patch, _patches, list) > + klp_for_each_patch(patch) > patch->forced = true; > } > -- > 2.13.7 > Acked-by: Joe Lawrence -- Joe

Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-21 Thread Joe Lawrence
On Wed, Jan 16, 2019 at 05:17:18PM +0100, Petr Mladek wrote: > Do not dereference pointers to the shadow variables when either > klp_shadow_alloc() or klp_shadow_get() fail. > > There is no need to check the other locations explicitly. The test > would fail if any allocation fails. And the

Re: [PATCH 3/4] livepatch: Module coming and going callbacks can proceed all listed patches

2019-01-21 Thread Joe Lawrence
t;enabled && patch != klp_transition_patch) > - break; > - > pr_notice("applying patch '%s' to loading module > '%s'\n", > patch->mod->name, obj->mod->name); > > -- > 2.13.7 > Any simplication to the callback code is welcome! Thanks for cleaning this one up. With a few commit msg nits, Acked-by: Joe Lawrence -- Joe

Re: [PATCH 4/4] livepatch: Remove the redundant enabled flag in struct klp_patch

2019-01-21 Thread Joe Lawrence
klp_target_state == KLP_PATCHED ? "patching to unpatching" : > "unpatching to patching"); > > - klp_transition_patch->enabled = !klp_transition_patch->enabled; > - > klp_target_state = !klp_target_state; > > /* > diff --git a/kernel/livepatch/transition.h b/kernel/livepatch/transition.h > index f9d0bc016067..b9f3e96d8c13 100644 > --- a/kernel/livepatch/transition.h > +++ b/kernel/livepatch/transition.h > @@ -5,6 +5,7 @@ > #include > > extern struct klp_patch *klp_transition_patch; > +extern int klp_target_state; > > void klp_init_transition(struct klp_patch *patch, int state); > void klp_cancel_transition(void); > -- > 2.13.7 > With commit msg nits, Acked-by: Joe Lawrence -- Joe

ppc64le reliable stack unwinder and scheduled tasks

2019-01-10 Thread Joe Lawrence
Hi all, tl;dr: On ppc64le, what is top-most stack frame for scheduled tasks about? I am looking at a bug in which ~10% of livepatch tests on RHEL-7 and RHEL-8 distro kernels, the ppc64le reliable stack unwinder consistently reports an unreliable stack for a given task. This condition

Re: ppc64le reliable stack unwinder and scheduled tasks

2019-01-10 Thread Joe Lawrence
On Fri, Jan 11, 2019 at 01:00:38AM +0100, Nicolai Stange wrote: > Hi Joe, > > Joe Lawrence writes: > > > tl;dr: On ppc64le, what is top-most stack frame for scheduled tasks > >about? > > If I'm reading the code in _switch() correctly, the first frame

Re: [PATCH v2] x86/tools/relocs: fix big section header tables

2019-01-11 Thread Joe Lawrence
On Thu, Nov 29, 2018 at 09:57:50AM -0600, Josh Poimboeuf wrote: > On Thu, Nov 29, 2018 at 04:56:15PM +0100, Artem Savkov wrote: > > In case when the number of entries in the section header table is larger > > then or equal to SHN_LORESERVE the size of the table is held in the sh_size > > member of

Re: s390: runtime warning about pgtables_bytes

2018-10-31 Thread Joe Lawrence
On Fri, Oct 12, 2018 at 05:08:33PM +0200, Martin Schwidefsky wrote: > On Thu, 11 Oct 2018 15:02:11 +0200 > Martin Schwidefsky wrote: > > > On Thu, 11 Oct 2018 18:04:12 +0800 > > Li Wang wrote: > > > > > When running s390 system with LTP/cve-2017-17052.c[1], the following BUG > > > is > > >

Re: [PATCH] floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl

2018-09-20 Thread Joe Lawrence
On Mon, Aug 27, 2018 at 12:45:25AM -0700, Kees Cook wrote: > On Tue, May 29, 2018 at 6:27 AM, Andy Whitcroft > wrote: > > On Wed, Mar 07, 2018 at 04:02:45PM -0800, Brian Belleville wrote: > >> The final field of a floppy_struct is the field "name", which is a > >> pointer to a string in kernel

Re: schedule_delayed_work with a 0 jiffy delay

2014-09-28 Thread Joe Lawrence
On Sun, 28 Sep 2014, Tejun Heo wrote: > Hello, Joe. > > On Fri, Sep 26, 2014 at 10:52:27AM -0400, Joe Lawrence wrote: > ... > > I was wondering if such behavior was expected on !PREEMPT kernels, > > especially after b22ce2785d97 "workqueue: cond_resched() after

Re: [PATCH v3 0/2] block,scsi: fixup blk_get_request dead queue scenarios

2014-08-27 Thread Joe Lawrence
On Tue, 26 Aug 2014 18:01:23 -0400 Jeff Moyer wrote: > Jens Axboe writes: > > >> I have applied the first one, will look over the second one and hand > >> apply it. Seems the NULL return was completely removed, so we _should_ > >> be ok on the IS_ERR() conversion, though that sort of thing

Re: [PATCH v3 0/2] block,scsi: fixup blk_get_request dead queue scenarios

2014-08-27 Thread Joe Lawrence
On Wed, 27 Aug 2014 08:07:29 -0600 Jens Axboe wrote: > On 08/26/2014 04:01 PM, Jeff Moyer wrote: > >> Additionally, there's still quite a few places that call > >> blk_get_request() and don't check the error return if __GFP_WAIT is set. > >> Since most of the point of this is to fix segfaulting

Re: [PATCH] checkpatch: Add test for commit id formatting style in commit log

2014-08-27 Thread Joe Lawrence
> Try to standardize on a 12 character long lower case > commit id along with a description of parentheses and > the quoted subject line > > ie: commit 0123456789ab ("commit description") Hi Joe / Andrew, I don't know if checkpatch is built for multiline regex, but I noticed that this new check

Re: [PATCH] checkpatch: Allow commit descriptions on separate line from commit id

2014-08-27 Thread Joe Lawrence
e line like: > > Some explanation as to why commit <12+hexdigits> > ("commit description/subject line") is improved. > > Allow this form. > > Signed-off-by: Joe Perches > Suggested-by: Joe Lawrence '. (Maybe another checkpatch validation for anot

schedule_delayed_work with a 0 jiffy delay

2014-09-26 Thread Joe Lawrence
Hello Tejun, (RHEL7 kernel, see config below) I'm debugging an RCU stall where it seems that the culprit is a kworker workqueue function that decides to reschedule itself over and over via schedule_delayed_work with a 0 jiffy delay. If I watch rcudata, I can see that the CPU currently running

Re: [PATCH 1/2] mpt2sas: Refcount sas_device objects and fix unsafe list usage

2015-07-13 Thread Joe Lawrence
On 07/12/2015 12:24 AM, Calvin Owens wrote: > These objects can be referenced concurrently throughout the driver, we > need a way to make sure threads can't delete them out from under each > other. This patch adds the refcount, and refactors the code to use it. > > Additionally, we cannot iterate

[PATCH] workqueue: add quiescent state between work items

2014-10-04 Thread Joe Lawrence
d only iff there are other higher priority tasks to run, so force a quiescent RCU state between work items with cond_resched_rcu_qs. Signed-off-by: Joe Lawrence Link: https://lkml.kernel.org/r/20140926105227.01325...@jlaw-desktop.mno.stratus.com Link: https://lkml.kernel.org/r/20140929115445.402

[PATCH v2 1/2] workqueue: add quiescent state between work items

2014-10-05 Thread Joe Lawrence
d only iff there are other higher priority tasks to run, so force a quiescent RCU state between work items. Signed-off-by: Joe Lawrence Link: https://lkml.kernel.org/r/20140926105227.01325...@jlaw-desktop.mno.stratus.com Link: https://lkml.kernel.org/r/20140929115445.40221...@jlaw-desktop.mno.s

[PATCH v2 0/2] workqueue: add RCU quiescent state between items

2014-10-05 Thread Joe Lawrence
v2 - split into two patches: the first inlines the cond_resched_rcu_qs macro suitable for stable backport, the second converts to using cond_resched_rcu_qs. Joe Lawrence (2): workqueue: add quiescent state between work items workqueue: use cond_resched_rcu_qs macro kernel/workqueue.c |5

[PATCH v2 2/2] workqueue: use cond_resched_rcu_qs macro

2014-10-05 Thread Joe Lawrence
Tidy up and use cond_resched_rcu_qs when calling cond_resched and reporting potential quiescent state to RCU. Signed-off-by: Joe Lawrence --- kernel/workqueue.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 345bec9

Re: [PATCH v2 1/2] workqueue: add quiescent state between work items

2014-10-07 Thread Joe Lawrence
On Tue, 7 Oct 2014 06:43:29 -0700 "Paul E. McKenney" wrote: > On Tue, Oct 07, 2014 at 09:29:42AM +0200, Jiri Pirko wrote: [ ... snip ... ] > > > > Paul, Tehun, how do you propose to fix this on older kernels which do > > not have rcu_note_voluntary_context_switch? I'm particullary interested >

Re: [PATCH 17/20] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-12 Thread Joe Lawrence
On 06/12/2015 05:42 AM, Sreekanth Reddy wrote: ... > +#if defined(alloc_ordered_workqueue) > + ioc->firmware_event_thread = alloc_ordered_workqueue( > + ioc->firmware_event_name, WQ_MEM_RECLAIM); > +#else > + ioc->firmware_event_thread = create_singlethread_workqueue( >

Re: [PATCH] [RESEND] qla2xxx: prevent board_disable from running during EEH

2015-06-26 Thread Joe Lawrence
On 06/26/2015 12:33 PM, Mauricio Faria de Oliveira wrote: > Commit f3ddac1918fe963bcbf8d407a3a3c0881b47248b ("[SCSI] qla2xxx: > Disable adapter when we encounter a PCI disconnect.") has introduced a > code that disables the board, releasing some resources, when reading > 0x. > > In case

Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-18 Thread Joe Lawrence
On 06/16/2015 01:37 AM, Sreekanth Reddy wrote: > Created a thread using alloc_ordered_workqueue() API in order to process > the works from firmware Work-queue sequentially instead of > create_singlethread_workqueue() API. > > Changes in v1: > No need to check for backport compatibility in the

Re: [PATCH 17/20 v1] [SCSI] mpt3sas: Use alloc_ordered_workqueue() API instead of create_singlethread_workqueue() API

2015-06-18 Thread Joe Lawrence
On 06/18/2015 09:06 AM, Sreekanth Reddy wrote: > On Thu, Jun 18, 2015 at 5:40 PM, Joe Lawrence > wrote: >> On 06/16/2015 01:37 AM, Sreekanth Reddy wrote: >>> Created a thread using alloc_ordered_workqueue() API in order to process >>> the works from firmware W

<    1   2   3   4   5   6   7   >