Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Song Liu
> On Aug 26, 2019, at 8:08 AM, Song Liu wrote: > > > >> On Aug 26, 2019, at 2:23 AM, Peter Zijlstra wrote: >> >> So only the high mapping is ever executable; the identity map should not >> be. Both should be RO. >> >>> kprobe (with CONFIG_KPROBES_ON_FTRACE) should work on kernel identity

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Nadav Amit
> On Aug 26, 2019, at 8:56 AM, Steven Rostedt wrote: > > On Mon, 26 Aug 2019 15:41:24 + > Nadav Amit wrote: > >>> Anyway, I believe Nadav has some patches that converts ftrace to use >>> the shadow page modification trick somewhere. >> >> For the record - here is my previous patch: >> ht

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Peter Zijlstra
On Mon, Aug 26, 2019 at 03:41:24PM +, Nadav Amit wrote: > For the record - here is my previous patch: > https://lkml.org/lkml/2018/12/5/211 Thanks!

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Steven Rostedt
On Mon, 26 Aug 2019 15:41:24 + Nadav Amit wrote: > > Anyway, I believe Nadav has some patches that converts ftrace to use > > the shadow page modification trick somewhere. > > For the record - here is my previous patch: > https://lkml.org/lkml/2018/12/5/211 FYI, when referencing older pat

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Nadav Amit
> On Aug 26, 2019, at 4:33 AM, Steven Rostedt wrote: > > On Fri, 23 Aug 2019 11:36:37 +0200 > Peter Zijlstra wrote: > >> On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: >>> As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to >>> split_large_page() for all kernel

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Song Liu
> On Aug 26, 2019, at 2:23 AM, Peter Zijlstra wrote: > > So only the high mapping is ever executable; the identity map should not > be. Both should be RO. > >> kprobe (with CONFIG_KPROBES_ON_FTRACE) should work on kernel identity >> mapping. > > Please provide more information; kprobes shou

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Peter Zijlstra
On Mon, Aug 26, 2019 at 07:33:08AM -0400, Steven Rostedt wrote: > Anyway, I believe Nadav has some patches that converts ftrace to use > the shadow page modification trick somewhere. > > Or we also need the text_poke batch processing (did that get upstream?). It did. And I just did that patch; I'

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Steven Rostedt
On Fri, 23 Aug 2019 11:36:37 +0200 Peter Zijlstra wrote: > On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: > > As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to > > split_large_page() for all kernel text pages. This means a single kprobe > > will put all kernel t

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-26 Thread Peter Zijlstra
On Mon, Aug 26, 2019 at 04:40:23AM +, Song Liu wrote: > Cc: Steven Rostedt and Suresh Siddha > > Hi Peter, > > > On Aug 23, 2019, at 2:36 AM, Peter Zijlstra wrote: > > > > On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: > >> As 4k pages check was removed from cpa [1], set_kernel_

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-25 Thread Song Liu
Cc: Steven Rostedt and Suresh Siddha Hi Peter, > On Aug 23, 2019, at 2:36 AM, Peter Zijlstra wrote: > > On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: >> As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to >> split_large_page() for all kernel text pages. This m

Re: [PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-23 Thread Peter Zijlstra
On Thu, Aug 22, 2019 at 10:23:35PM -0700, Song Liu wrote: > As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to > split_large_page() for all kernel text pages. This means a single kprobe > will put all kernel text in 4k pages: > > root@ ~# grep 8100- /sys/kernel/deb

[PATCH] x86/mm: Do not split_large_page() for set_kernel_text_rw()

2019-08-22 Thread Song Liu
As 4k pages check was removed from cpa [1], set_kernel_text_rw() leads to split_large_page() for all kernel text pages. This means a single kprobe will put all kernel text in 4k pages: root@ ~# grep 8100- /sys/kernel/debug/page_tables/kernel 0x8100-0x8240 20