Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Steven Rostedt
On Tue, 22 Oct 2019 22:24:01 +0200 Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 10:21:10PM -0400, Steven Rostedt wrote: > > On Fri, 18 Oct 2019 09:35:40 +0200 > > Peter Zijlstra wrote: > > > > > Now that set_all_modules_text_*() is gone, nothing depends on the > > > relation between

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Josh Poimboeuf
On Wed, Oct 23, 2019 at 05:16:54PM +0200, Peter Zijlstra wrote: > @@ -157,6 +158,14 @@ static int __apply_relocate_add(Elf64_Sh > > val = sym->st_value + rel[i].r_addend; > > + /* > + * .klp.rela.* sections should only contain module > + *

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Josh Poimboeuf
On Wed, Oct 23, 2019 at 01:48:35PM +0200, Peter Zijlstra wrote: > Now sadly that commit missed all the useful information, luckily I could > find the patch in my LKML folder, more sad, that thread still didn't > contain the actual useful information, for that I was directed to > github: > >

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Peter Zijlstra
On Wed, Oct 23, 2019 at 01:48:35PM +0200, Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > > On Mon, Oct 21, 2019 at 08:53:12AM -0500, Josh Poimboeuf wrote: > > > > Doesn't livepatch code also need to be modified? We have: > > > > Urgh bah.. I was too

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 08:53:12AM -0500, Josh Poimboeuf wrote: > > Doesn't livepatch code also need to be modified? We have: > > Urgh bah.. I was too focussed on the other klp borkage :/ But yes, > arm64/ftrace and klp are the

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-23 Thread Peter Zijlstra
On Tue, Oct 22, 2019 at 04:40:23PM -0400, Steven Rostedt wrote: > On Tue, 22 Oct 2019 22:24:01 +0200 > Peter Zijlstra wrote: > > I'm not particularly proud of the "__function__" hack, but it works :/ I > > If anything, that should be defined as a macro: > > #define TRACE_EVENT_FIELD_SPECIAL

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-22 Thread Steven Rostedt
On Tue, 22 Oct 2019 22:24:01 +0200 Peter Zijlstra wrote: > The below seems to cure it; and seems to generate identical > events/*/format output (for my .config, with the exception of ID). > > It has just one section mismatch report that I'm too tired to look at > just now. Thanks, I'll try to

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-22 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 10:21:10PM -0400, Steven Rostedt wrote: > On Fri, 18 Oct 2019 09:35:40 +0200 > Peter Zijlstra wrote: > > > Now that set_all_modules_text_*() is gone, nothing depends on the > > relation between ->state = COMING and the protection state anymore. > > This enables moving the

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-22 Thread Peter Zijlstra
On Tue, Oct 22, 2019 at 01:31:16PM +0200, Heiko Carstens wrote: > On Mon, Oct 21, 2019 at 06:11:35PM +0200, Peter Zijlstra wrote: > > On Mon, Oct 21, 2019 at 05:34:25PM +0200, Peter Zijlstra wrote: > > > On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > > > > > So On IRC Josh

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-22 Thread Heiko Carstens
On Mon, Oct 21, 2019 at 06:11:35PM +0200, Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 05:34:25PM +0200, Peter Zijlstra wrote: > > On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > > > So On IRC Josh suggested we use text_poke() for RELA. Since KLP is only > > available on

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Steven Rostedt
On Fri, 18 Oct 2019 09:35:40 +0200 Peter Zijlstra wrote: > Now that set_all_modules_text_*() is gone, nothing depends on the > relation between ->state = COMING and the protection state anymore. > This enables moving the protection changes later, such that the COMING > notifier callbacks can

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 05:34:25PM +0200, Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > So On IRC Josh suggested we use text_poke() for RELA. Since KLP is only > available on Power and x86, and Power does not have STRICT_MODULE_RWX, > the below should

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 05:34:25PM +0200, Peter Zijlstra wrote: > So On IRC Josh suggested we use text_poke() for RELA. Since KLP is only > available on Power and x86, and Power does not have STRICT_MODULE_RWX, > the below should be sufficient. And... s390 also has HAVE_LIVEPATCH and

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 04:14:02PM +0200, Peter Zijlstra wrote: > On Mon, Oct 21, 2019 at 08:53:12AM -0500, Josh Poimboeuf wrote: > > On Fri, Oct 18, 2019 at 09:35:40AM +0200, Peter Zijlstra wrote: > > > Now that set_all_modules_text_*() is gone, nothing depends on the > > > relation between

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Peter Zijlstra
On Mon, Oct 21, 2019 at 08:53:12AM -0500, Josh Poimboeuf wrote: > On Fri, Oct 18, 2019 at 09:35:40AM +0200, Peter Zijlstra wrote: > > Now that set_all_modules_text_*() is gone, nothing depends on the > > relation between ->state = COMING and the protection state anymore. > > This enables moving

Re: [PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-21 Thread Josh Poimboeuf
On Fri, Oct 18, 2019 at 09:35:40AM +0200, Peter Zijlstra wrote: > Now that set_all_modules_text_*() is gone, nothing depends on the > relation between ->state = COMING and the protection state anymore. > This enables moving the protection changes later, such that the COMING > notifier callbacks

[PATCH v4 15/16] module: Move where we mark modules RO,X

2019-10-18 Thread Peter Zijlstra
Now that set_all_modules_text_*() is gone, nothing depends on the relation between ->state = COMING and the protection state anymore. This enables moving the protection changes later, such that the COMING notifier callbacks can more easily modify the text. Signed-off-by: Peter Zijlstra (Intel)