Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Michael Neuling
On Thu, 2018-09-13 at 07:38 +0200, Christophe LEROY wrote: > > Le 13/09/2018 à 03:21, Tyrel Datwyler a écrit : > > On 09/12/2018 05:36 PM, Michael Neuling wrote: > > > > > > > > > > > > + (unsigned long)patch_addr); > > > > > > > > Please align second line as per Codying

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 13/09/2018 à 02:36, Michael Neuling a écrit : --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -23,11 +23,33 @@ #include #include + This blank line is not needed Ack +static inline bool in_init_section(unsigned int *patch_addr) +{ +

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 13/09/2018 à 03:21, Tyrel Datwyler a écrit : On 09/12/2018 05:36 PM, Michael Neuling wrote: + (unsigned long)patch_addr); Please align second line as per Codying style. Sorry I can't see what's wrong. You're (or Cody :-P) going to have to spell it this out

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Tyrel Datwyler
On 09/12/2018 05:36 PM, Michael Neuling wrote: > >>> --- a/arch/powerpc/lib/code-patching.c >>> +++ b/arch/powerpc/lib/code-patching.c >>> @@ -23,11 +23,33 @@ >>> #include >>> #include >>> >>> + >> >> This blank line is not needed > > Ack > >> >>> +static inline bool

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Michael Neuling
> > --- a/arch/powerpc/lib/code-patching.c > > +++ b/arch/powerpc/lib/code-patching.c > > @@ -23,11 +23,33 @@ > > #include > > #include > > > > + > > This blank line is not needed Ack > > > +static inline bool in_init_section(unsigned int *patch_addr) > > +{ > > + if (patch_addr <

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 12/09/2018 à 07:20, Michael Neuling a écrit : This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck()

[PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-11 Thread Michael Neuling
This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck() -> barrier_nospec(); We have a code patching