mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-07 11:28:32 +00:00
x86/signals: Merge EFLAGS bit clearing into a single statement
Merging EFLAGS bit clearing into a single statement, to ensure EFLAGS bits are being cleared in a single instruction. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Tested-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com> Originally-Reported-by: Vince Weaver <vincent.weaver@maine.edu> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: Stephane Eranian <eranian@google.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1367421944-19082-4-git-send-email-jolsa@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
24cda10996
commit
ddd40da4cc
1 changed files with 3 additions and 7 deletions
|
@ -662,21 +662,17 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
|
||||||
if (!failed) {
|
if (!failed) {
|
||||||
/*
|
/*
|
||||||
* Clear the direction flag as per the ABI for function entry.
|
* Clear the direction flag as per the ABI for function entry.
|
||||||
*/
|
*
|
||||||
regs->flags &= ~X86_EFLAGS_DF;
|
|
||||||
/*
|
|
||||||
* Clear RF when entering the signal handler, because
|
* Clear RF when entering the signal handler, because
|
||||||
* it might disable possible debug exception from the
|
* it might disable possible debug exception from the
|
||||||
* signal handler.
|
* signal handler.
|
||||||
*/
|
*
|
||||||
regs->flags &= ~X86_EFLAGS_RF;
|
|
||||||
/*
|
|
||||||
* Clear TF when entering the signal handler, but
|
* Clear TF when entering the signal handler, but
|
||||||
* notify any tracer that was single-stepping it.
|
* notify any tracer that was single-stepping it.
|
||||||
* The tracer may want to single-step inside the
|
* The tracer may want to single-step inside the
|
||||||
* handler too.
|
* handler too.
|
||||||
*/
|
*/
|
||||||
regs->flags &= ~X86_EFLAGS_TF;
|
regs->flags &= ~(X86_EFLAGS_DF|X86_EFLAGS_RF|X86_EFLAGS_TF);
|
||||||
}
|
}
|
||||||
signal_setup_done(failed, ksig, test_thread_flag(TIF_SINGLESTEP));
|
signal_setup_done(failed, ksig, test_thread_flag(TIF_SINGLESTEP));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue