From: "H. Peter Anvin" <hpa@zytor.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Andi Kleen <andi@firstfloor.org>, Oleg Nesterov <oleg@redhat.com>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Vince Weaver <vincent.weaver@maine.edu>
Subject: Re: [PATCH 2/5] signal x86: Clear RF EFLAGS bit for signal handler
Date: Fri, 01 Mar 2013 10:57:50 -0800 [thread overview]
Message-ID: <5130FA2E.9010502@zytor.com> (raw)
In-Reply-To: <1362161512-16803-3-git-send-email-jolsa@redhat.com>
On 03/01/2013 10:11 AM, Jiri Olsa wrote:
> Clearing RF EFLAGS bit for signal handler. The reason is,
> that this flag is set by debug exception code to prevent
> the recursive exception entry.
>
> Leaving it set for signal handler might prevent debug
> exception of the signal handler itself.
>
> diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
> index b6fe116..e273571 100644
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -726,6 +726,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
> regs->flags &= ~X86_EFLAGS_DF;
>
> /*
> + * Clear RF when entering the signal handler, because
> + * it might disable possible debug exception from the
> + * signal handler.
> + */
> + regs->flags &= ~X86_EFLAGS_RF;
> +
> + /*
> * Clear TF when entering the signal handler, but
> * notify any tracer that was single-stepping it.
> * The tracer may want to single-step inside the
>
Makes sense. However, can you combine all the flags-clearing into one
statement while you are at it?
-hpa
next prev parent reply other threads:[~2013-03-01 19:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-01 18:11 [RFC 0/5] perf, signal x86: Fix breakpoint events overflow handling Jiri Olsa
2013-03-01 18:11 ` [PATCH 1/5] signal x86: Propage RF EFLAGS bit throught the signal restore call Jiri Olsa
2013-03-01 18:11 ` [PATCH 2/5] signal x86: Clear RF EFLAGS bit for signal handler Jiri Olsa
2013-03-01 18:57 ` H. Peter Anvin [this message]
2013-03-03 10:43 ` Jiri Olsa
2013-03-10 17:15 ` Jiri Olsa
2013-03-10 18:31 ` Jiri Olsa
2013-03-01 18:11 ` [PATCH 3/5] perf: Fix hw breakpoints overflow period sampling Jiri Olsa
2013-03-01 18:11 ` [PATCH 4/5] perf tests: Test breakpoint overflow signal handler Jiri Olsa
2013-03-01 18:11 ` [PATCH 5/5] perf tests: Test breakpoint overflow signal handler counts Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5130FA2E.9010502@zytor.com \
--to=hpa@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=andi@firstfloor.org \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
--cc=vincent.weaver@maine.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.