Re: Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-09-12 Thread hpa
On September 12, 2019 8:00:39 AM GMT+01:00, Adrian Hunter wrote: >On 29/08/19 2:46 PM, Peter Zijlstra wrote: >> On Thu, Aug 29, 2019 at 12:40:56PM +0300, Adrian Hunter wrote: >>> Can you expand on "and ensure the poke_handler preserves the >existing >>> control flow"? Whatever the INT3-handler

Re: Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-09-12 Thread Adrian Hunter
On 29/08/19 2:46 PM, Peter Zijlstra wrote: > On Thu, Aug 29, 2019 at 12:40:56PM +0300, Adrian Hunter wrote: >> Can you expand on "and ensure the poke_handler preserves the existing >> control flow"? Whatever the INT3-handler does will be traced normally so >> long as it does not itself execute

Re: Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-08-29 Thread Peter Zijlstra
On Thu, Aug 29, 2019 at 12:40:56PM +0300, Adrian Hunter wrote: > Can you expand on "and ensure the poke_handler preserves the existing > control flow"? Whatever the INT3-handler does will be traced normally so > long as it does not itself execute self-modified code. My thinking was that the code

Re: Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-08-29 Thread Adrian Hunter
On 29/08/19 11:53 AM, Peter Zijlstra wrote: > On Thu, Aug 29, 2019 at 11:23:52AM +0300, Adrian Hunter wrote: >> On 9/01/19 12:35 PM, Peter Zijlstra wrote: >>> On Tue, Jan 08, 2019 at 12:47:42PM -0800, Nadav Amit wrote: >>> A general solution is more complicated, however, due to the racy

Re: Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-08-29 Thread Peter Zijlstra
On Thu, Aug 29, 2019 at 11:23:52AM +0300, Adrian Hunter wrote: > On 9/01/19 12:35 PM, Peter Zijlstra wrote: > > On Tue, Jan 08, 2019 at 12:47:42PM -0800, Nadav Amit wrote: > > > >> A general solution is more complicated, however, due to the racy nature of > >> cross-modifying code. There would

Tracing text poke / kernel self-modifying code (Was: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion)

2019-08-29 Thread Adrian Hunter
On 9/01/19 12:35 PM, Peter Zijlstra wrote: > On Tue, Jan 08, 2019 at 12:47:42PM -0800, Nadav Amit wrote: > >> A general solution is more complicated, however, due to the racy nature of >> cross-modifying code. There would need to be TSC recording of the time >> before the modifications start and