Re: [PATCH -tip v8 0/9] kprobes: Kprobes jump optimization support

Masami Hiramatsu
2010-01-22T21:00:16Z

Mathieu Desnoyers wrote:
> * Masami Hiramatsu (mhiramat@redhat.com) wrote:
>> Hi,
>>
>> Here are the patchset of the kprobes jump optimization v8
>> (a.k.a. Djprobe). This version is just moving onto
>> 2.6.33-rc4-tip. Ingo, I assume its a good timing to
>> push this code onto -tip tree (maybe developing branch?),
>> since people can test it with perf-probe.
>>
>> I've decided to make a separated series of patches of
>> jump optimization with text_poke_smp() which is
>> 'officially' supported on Intel's processors.
>> So, this version of patches are just updated against
>> the latest tip/master, no other updates are included.
>>
>> I know that int3-bypassing method (text_poke_fixup())
>> is currently unofficially believed as safe. But we
>> need to get more official answers from x86 vendors.
>> Moreover, we need to tweak entry_*.S for preventing
>> recursive NMI, because int3 inside NMI handler will
>> unblock NMI blocking. I'd like to push it after this
>> series of patches are merged.
>>
>> Anyway, thanks Mathieu and Peter, for helping me to
>> implement it and organizing discussion points about
>> int3-bypass XMC!
>>
>> These patches can be applied on the latest -tip.
>>
>> Changes in v8:
>> - Update patches against the latest tip/master.
>> - Drop text_poke_fixup() related patches.
>> - Update benchmark results and add jprobes and kprobe(post-handler)
>> results.
>>
>> And kprobe stress test didn't found any regressions - from kprobes,
>> under kvm/x86.
>>
>> TODO:
>> - Support NMI-safe int3-bypassing text_poke.
>
> Please have a look at:
>
> "x86 NMI-safe INT3 and Page Fault"
> http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=commit;h=90516e3c718e0502f6f2eb616fad4447645ca47d
>
> and
>
> "x86_64 page fault NMI-safe"
> http://git.kernel.org/?p=linux/kernel/git/compudj/linux-2.6-lttng.git;a=commit;h=ad1bf11a68c35a44edd8d686a0842896f408e17c
>
> That turns this TODO into the "done" section ;)
>
> I've been using these patches in the lttng tree for 1-2 years.

Hi Mathieu,

Sure, those looks good to me too. Thanks!

I'd just like to separate this issue from kprobe jump optimization
itself this time, because;
- text_poke_fixup() is not necessary to kprobes :-)
- the int3-bypassing text_poke method is still unofficially ensured
by intel people. and we also need to require answers from other
x86 compatible processor vendors.

Anyway, my next series of patches will contain those patches.

BTW, I think your 2nd patch seems good to send to upstream separately.

Thank you!