From: Jiri Olsa <jolsa@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.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: Sun, 10 Mar 2013 19:31:40 +0100 [thread overview]
Message-ID: <20130310183140.GB1724@krava.brq.redhat.com> (raw)
In-Reply-To: <20130310171518.GA1724@krava.brq.redhat.com>
On Sun, Mar 10, 2013 at 06:15:18PM +0100, Jiri Olsa wrote:
> On Sun, Mar 03, 2013 at 11:43:21AM +0100, Jiri Olsa wrote:
> > On Fri, Mar 01, 2013 at 10:57:50AM -0800, H. Peter Anvin wrote:
> > > 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?
>
> Is there any other reason for this besides having just signal
s/signal/single/ ;-)
jirka
> instruction doing this update?
>
> It looks like gcc is smart enough to do that anyway:
>
> ...
> andq $0xfffffffffffffaff,(%rdi)
> ...
>
>
> I need to send V2 anyway, since the patchset no longer
> applies into latest tip.
>
> thanks,
> jirka
next prev parent reply other threads:[~2013-03-10 18:32 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
2013-03-03 10:43 ` Jiri Olsa
2013-03-10 17:15 ` Jiri Olsa
2013-03-10 18:31 ` Jiri Olsa [this message]
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=20130310183140.GB1724@krava.brq.redhat.com \
--to=jolsa@redhat.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=hpa@zytor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®