From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Richard Weinberger <richard-/L3Ra7n9ekc@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
vgupta-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
catalin.marinas-5wv7dgnIgG8@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org,
vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org,
msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
a-jacquiot-l0cyMroinI0@public.gmane.org,
starvik-VrBV9hrLPhE@public.gmane.org,
jesper.nilsson-VrBV9hrLPhE@public.gmane.org,
dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
rkuo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
fenghua.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
takata-TMSiXQfHlQjsTix1lMzHGQ@public.gmane.org,
geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org,
monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org,
yasutake.koichi-NAum8xwdG0+S7A1Ibl2khg@public.gmane.org,
ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org,
jonas-A9uVI2HLR7kOP4wsBPIw7w@public.gmane.org,
jejb-6jwH94ZQLHl74goWV3ctuw@public.gmane.org,
deller-Mmb7MZpHnFY@public.gmane.org,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org,
paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org,
schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org,
heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org,
liqin.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
lennox.wu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
cmetcalf-kv+TWInifGbQT0dZR+AlfA@public.gmane.org,
gxt-TG0Ac1+ktVePQbnJrJN+5g@public.gmane.org,
linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
oleg@redhat.
Subject: Re: [PATCH 12/44] metag: Use get_signal() signal_setup_done()
Date: Mon, 3 Mar 2014 11:15:12 +0000 [thread overview]
Message-ID: <53146440.707@imgtec.com> (raw)
In-Reply-To: <1393804646-7797-2-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2764 bytes --]
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?
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 --]
WARNING: multiple messages have this Message-ID (diff)
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: Mon, 3 Mar 2014 11:15:12 +0000 [thread overview]
Message-ID: <53146440.707@imgtec.com> (raw)
Message-ID: <20140303111512.oc4VX78za87op5WFPywZHuNf7tCAFO3OEoX79yIP-lk@z> (raw)
In-Reply-To: <1393804646-7797-2-git-send-email-richard@nod.at>
[-- Attachment #1: Type: text/plain, Size: 2764 bytes --]
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?
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-03 11:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-02 23:57 [PATCH 11/44] m68k: Use get_signal() signal_setup_done() Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 12/44] metag: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
[not found] ` <1393804646-7797-2-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
2014-03-03 11:15 ` James Hogan [this message]
2014-03-03 11:15 ` James Hogan
2014-03-18 11:41 ` James Hogan
2014-03-18 11:41 ` James Hogan
2014-03-02 23:57 ` [PATCH 13/44] microblaze: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 14/44] mips: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 15/44] mn10300: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 16/44] parisc: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 17/44] powerpc: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 18/44] s390: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 19/44] score: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 20/44] sh: " Richard Weinberger
2014-03-02 23:57 ` Richard Weinberger
2014-03-02 23:57 ` [PATCH 21/44] tile: " Richard Weinberger
2014-03-02 23:57 ` 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=53146440.707@imgtec.com \
--to=james.hogan-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
--cc=a-jacquiot-l0cyMroinI0@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=cmetcalf-kv+TWInifGbQT0dZR+AlfA@public.gmane.org \
--cc=deller-Mmb7MZpHnFY@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=egtvedt-BrfabpQBY5qlHtIdYg32fQ@public.gmane.org \
--cc=fenghua.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=gxt-TG0Ac1+ktVePQbnJrJN+5g@public.gmane.org \
--cc=heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jejb-6jwH94ZQLHl74goWV3ctuw@public.gmane.org \
--cc=jesper.nilsson-VrBV9hrLPhE@public.gmane.org \
--cc=jonas-A9uVI2HLR7kOP4wsBPIw7w@public.gmane.org \
--cc=lennox.wu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw@public.gmane.org \
--cc=liqin.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org \
--cc=msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=oleg@redhat. \
--cc=paulus-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
--cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
--cc=richard-/L3Ra7n9ekc@public.gmane.org \
--cc=rkuo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=schwidefsky-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=starvik-VrBV9hrLPhE@public.gmane.org \
--cc=takata-TMSiXQfHlQjsTix1lMzHGQ@public.gmane.org \
--cc=tony.luck-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
--cc=vgupta-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
--cc=yasutake.koichi-NAum8xwdG0+S7A1Ibl2khg@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).