Re: [PATCH -tip 0/3] x86/kprobes: Remoev single-step trap from x86 kprobes

2021-03-17 Thread Andy Lutomirski
On Wed, Mar 17, 2021 at 9:27 AM Peter Zijlstra  wrote:
>
> On Wed, Mar 17, 2021 at 11:55:22PM +0900, Masami Hiramatsu wrote:
> > Hi Andy,
> >
> > Would you think you still need this series to remove iret to kernel?
>
> They're an improvement anyway, let me queue them so that they don't get
> lost.
>
> I'll line them up for tip/x86/core unless anybody else thinks of a
> better place for them and tells me in time ;-)

I agree.  The new code is quite nice.  I'm still not quite sure what
I'm doing with IRET, but thank you very much for the kprobe
improvements.


Re: [PATCH -tip 0/3] x86/kprobes: Remoev single-step trap from x86 kprobes

2021-03-17 Thread Peter Zijlstra
On Wed, Mar 17, 2021 at 11:55:22PM +0900, Masami Hiramatsu wrote:
> Hi Andy,
> 
> Would you think you still need this series to remove iret to kernel?

They're an improvement anyway, let me queue them so that they don't get
lost.

I'll line them up for tip/x86/core unless anybody else thinks of a
better place for them and tells me in time ;-)


Re: [PATCH -tip 0/3] x86/kprobes: Remoev single-step trap from x86 kprobes

2021-03-17 Thread Masami Hiramatsu
Hi Andy,

Would you think you still need this series to remove iret to kernel?

Thank you,

On Wed,  3 Mar 2021 00:25:12 +0900
Masami Hiramatsu  wrote:

> Hi,
> 
> Here is a series of patches to remove the single-step debug trap from the
> x86 kprobe.
> 
> The first 2 patches ([1/3][2/3]) are bugfixes which I've sent recently;
> 
>  
> https://lore.kernel.org/lkml/161425451732.93763.18329509061375062554.stgit@devnote2/
> 
> And [3/3] is actually the patch to remove single-step from kprobes. The RFC
> version is here;
> 
>  
> https://lore.kernel.org/lkml/161460768474.430263.18425867006584111900.stgit@devnote2/
> 
> This uses int3 as Andy suggested instead of the debug trap, for removing the
> IRET which returns to kernel.
> Some instructions must be emulated and some instructions becomes not able
> to be probed, but as far as I can see those are not rare case.
> 
> Thank you,
> 
> ---
> 
> Masami Hiramatsu (3):
>   x86/kprobes: Retrieve correct opcode for group instruction
>   x86/kprobes: Identify far indirect JMP correctly
>   x86/kprobes: Use int3 instead of debug trap for single-step
> 
> 
>  arch/x86/include/asm/kprobes.h |   21 +-
>  arch/x86/kernel/kprobes/core.c |  524 
> ++--
>  arch/x86/kernel/traps.c|3 
>  3 files changed, 358 insertions(+), 190 deletions(-)
> 
> --
> Masami Hiramatsu (Linaro) 


-- 
Masami Hiramatsu