lkml.org 
[lkml]   [2019]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] x86/kprobes: Fix frame pointer annotations
On Thu, May 09, 2019 at 09:20:06AM -0700, Andy Lutomirski wrote:
> > +END(call_to_exception_trampoline)
> > --- a/arch/x86/kernel/kprobes/core.c
> > +++ b/arch/x86/kernel/kprobes/core.c
> > @@ -731,29 +731,8 @@ asm(
> > ".global kretprobe_trampoline\n"
> > ".type kretprobe_trampoline, @function\n"
> > "kretprobe_trampoline:\n"
> > - /* We don't bother saving the ss register */
> > -#ifdef CONFIG_X86_64
> > - " pushq %rsp\n"
> > - " pushfq\n"
> > - SAVE_REGS_STRING
> > - " movq %rsp, %rdi\n"
> > - " call trampoline_handler\n"
> > - /* Replace saved sp with true return address. */
> > - " movq %rax, 19*8(%rsp)\n"
> > - RESTORE_REGS_STRING
> > - " popfq\n"
> > -#else
> > - " pushl %esp\n"
> > - " pushfl\n"
> > - SAVE_REGS_STRING
> > - " movl %esp, %eax\n"
> > - " call trampoline_handler\n"
> > - /* Replace saved sp with true return address. */
> > - " movl %eax, 15*4(%esp)\n"
> > - RESTORE_REGS_STRING
> > - " popfl\n"
> > -#endif
> > - " ret\n"
> > + "push trampoline_handler\n"
> > + "jmp call_to_exception_trampoline\n"
> > ".size kretprobe_trampoline, .-kretprobe_trampoline\n"
> > );
>
>
> Potentially minor nit: you’re doing popfl, but you’re not doing TRACE_IRQ_whatever. This makes me think that you should either add the tracing (ugh!) or you should maybe just skip the popfl.


Note, kprobes (and ftrace for that matter) are not saving flags for
interrupts, but because it must not modify the sign, zero and carry flags.

-- Steve

\
 
 \ /
  Last update: 2019-05-09 19:44    [W:0.114 / U:1.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site