From: James Hogan <james.hogan@imgtec.com>
To: Richard Weinberger <richard@nod.at>
Cc: <linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>,
<viro@zeniv.linux.org.uk>, <vgupta@synopsys.com>,
<catalin.marinas@arm.com>, <will.deacon@arm.com>,
<hskinnemoen@gmail.com>, <egtvedt@samfundet.no>,
<vapier@gentoo.org>, <msalter@redhat.com>, <a-jacquiot@ti.com>,
<starvik@axis.com>, <jesper.nilsson@axis.com>,
<dhowells@redhat.com>, <rkuo@codeaurora.org>,
<tony.luck@intel.com>, <fenghua.yu@intel.com>,
<takata@linux-m32r.org>, <geert@linux-m68k.org>,
<monstr@monstr.eu>, <yasutake.koichi@jp.panasonic.com>,
<ralf@linux-mips.org>, <jonas@southpole.se>,
<jejb@parisc-linux.org>, <deller@gmx.de>,
<benh@kernel.crashing.org>, <paulus@samba.org>,
<schwidefsky@de.ibm.com>, <heiko.carstens@de.ibm.com>,
<liqin.linux@gmail.com>, <lennox.wu@gmail.com>,
<cmetcalf@tilera.com>, <gxt@mprc.pku.edu.cn>,
<linux-xtensa@linux-xtensa.org>, <akpm@linux-foundation.org>,
<oleg@redhat.com>, <tj@kernel.org>, <hch@infradead.org>,
linux-metag <linux-metag@vger.kernel.org>
Subject: Re: [PATCH 12/44] metag: Use get_signal() signal_setup_done()
Date: Tue, 18 Mar 2014 11:41:42 +0000 [thread overview]
Message-ID: <532830F6.8090305@imgtec.com> (raw)
In-Reply-To: <53146440.707@imgtec.com>
[-- Attachment #1: Type: text/plain, Size: 3037 bytes --]
On 03/03/14 11:15, James Hogan wrote:
> Hi Richard,
>
> On 02/03/14 23:57, Richard Weinberger wrote:
>> @@ -235,10 +230,8 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
>> static int do_signal(struct pt_regs *regs, int syscall)
>> {
>> unsigned int retval = 0, continue_addr = 0, restart_addr = 0;
>> - struct k_sigaction ka;
>> - siginfo_t info;
>> - int signr;
>> int restart = 0;
>> + struct ksignal ksig;
>>
>> /*
>> * By the end of rt_sigreturn the context describes the point that the
>> @@ -272,30 +265,30 @@ static int do_signal(struct pt_regs *regs, int syscall)
>> }
>>
>> /*
>> - * Get the signal to deliver. When running under ptrace, at this point
>> - * the debugger may change all our registers ...
>> - */
>> - signr = get_signal_to_deliver(&info, &ka, regs, NULL);
>> - /*
>> * Depending on the signal settings we may need to revert the decision
>> * to restart the system call. But skip this if a debugger has chosen to
>> * restart at a different PC.
>> */
>> if (regs->REG_PC != restart_addr)
>> restart = 0;
>> - if (signr > 0) {
>> +
>> + /*
>> + * Get the signal to deliver. When running under ptrace, at this point
>> + * the debugger may change all our registers ...
>> + */
>> + if (get_signal(&ksig)) {
>
> The patch all looks good to me except for this bit. You've moved the bit
> at which a ptrace debugger can alter the registers to after the check
> for whether the PC has been altered, which would still need to cancel
> the restart.
>
> Does something like the hunks below look reasonable to you?
>
> Would you like me to take this patch through the metag tree or do you
> want to keep them together?
I've applied the altered version of this patch to the metag tree for v3.15.
Thanks
James
>
> Cheers
> James
>
> @@ -275,7 +268,7 @@ static int do_signal(struct pt_regs *regs, int syscall)
> * Get the signal to deliver. When running under ptrace, at this point
> * the debugger may change all our registers ...
> */
> - signr = get_signal_to_deliver(&info, &ka, regs, NULL);
> + get_signal(&ksig);
> /*
> * Depending on the signal settings we may need to revert the decision
> * to restart the system call. But skip this if a debugger has chosen to
> @@ -283,19 +276,19 @@ static int do_signal(struct pt_regs *regs, int syscall)
> */
> if (regs->REG_PC != restart_addr)
> restart = 0;
> - if (signr > 0) {
> + if (ksig.sig > 0) {
> if (unlikely(restart)) {
> if (retval == -ERESTARTNOHAND
> || retval == -ERESTART_RESTARTBLOCK
> || (retval == -ERESTARTSYS
> - && !(ka.sa.sa_flags & SA_RESTART))) {
> + && !(ksig.ka.sa.sa_flags & SA_RESTART))) {
> regs->REG_RETVAL = -EINTR;
> regs->REG_PC = continue_addr;
> }
> }
>
> /* Whee! Actually deliver the signal. */
> - handle_signal(signr, &info, &ka, regs);
> + handle_signal(&ksig, regs);
> return 0;
> }
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-03-18 11:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-02 23:57 [PATCH 11/44] m68k: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 12/44] metag: " Richard Weinberger
2014-03-03 11:15 ` James Hogan
2014-03-18 11:41 ` James Hogan [this message]
2014-03-02 23:57 ` [PATCH 13/44] microblaze: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 14/44] mips: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 15/44] mn10300: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 16/44] parisc: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 17/44] powerpc: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 18/44] s390: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 19/44] score: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 20/44] sh: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 21/44] tile: " Richard Weinberger
2014-03-02 23:57 ` [PATCH 22/44] um: " Richard Weinberger
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=532830F6.8090305@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=a-jacquiot@ti.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=catalin.marinas@arm.com \
--cc=cmetcalf@tilera.com \
--cc=deller@gmx.de \
--cc=dhowells@redhat.com \
--cc=egtvedt@samfundet.no \
--cc=fenghua.yu@intel.com \
--cc=geert@linux-m68k.org \
--cc=gxt@mprc.pku.edu.cn \
--cc=hch@infradead.org \
--cc=heiko.carstens@de.ibm.com \
--cc=hskinnemoen@gmail.com \
--cc=jejb@parisc-linux.org \
--cc=jesper.nilsson@axis.com \
--cc=jonas@southpole.se \
--cc=lennox.wu@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-metag@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=liqin.linux@gmail.com \
--cc=monstr@monstr.eu \
--cc=msalter@redhat.com \
--cc=oleg@redhat.com \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
--cc=richard@nod.at \
--cc=rkuo@codeaurora.org \
--cc=schwidefsky@de.ibm.com \
--cc=starvik@axis.com \
--cc=takata@linux-m32r.org \
--cc=tj@kernel.org \
--cc=tony.luck@intel.com \
--cc=vapier@gentoo.org \
--cc=vgupta@synopsys.com \
--cc=viro@zeniv.linux.org.uk \
--cc=will.deacon@arm.com \
--cc=yasutake.koichi@jp.panasonic.com \
/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
Powered by JetHome