lkml.org 
[lkml]   [2012]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/6] ftrace/x86: Add separate function to save regs
From
Date
On Tue, 2012-07-03 at 17:29 +0900, Masami Hiramatsu wrote:


>
> > + /* Restore flags */
> > + pushq EFLAGS(%rsp)
> > + popfq
> > +
> > + MCOUNT_RESTORE_FRAME
>
> Here, if MCOUNT_RESTORE_FRAME has skip too, I think you don't
> need to restore flags before restoring other registers, like
> below;
>
> MCOUNT_RESTORE_FRAME 8
> popfq
>
> And also, this will prevent to modify flags before return by
> addq in MCOUNT_RESTORE_FRAME.

Ah, because the addq will modify flags :-/

Grumble, I guess I should implement this, even though it will make it a
little more complex. I thought it was better to restore flags
explicitly, but that's not the case.

OK, I'll make the update. As MCOUNT_SAVE_FRAME has the skip, I guess
it's not so bad to have restore have it too.

-- Steve

>
> > +
> > + jmp ftrace_return
> > +ftrace_restore_flags:
> > + popfq
> > + jmp ftrace_stub
> > +
> > +END(ftrace_regs_caller)
> > +
>
> Thank you,
>
>




\
 
 \ /
  Last update: 2012-07-11 19:01    [W:0.111 / U:1.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site