* Re: [PATCH 12/44] metag: Use get_signal() signal_setup_done()
[not found] ` <1393804646-7797-2-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
@ 2014-03-03 11:15 ` James Hogan
2014-03-18 11:41 ` James Hogan
0 siblings, 1 reply; 2+ messages in thread
From: James Hogan @ 2014-03-03 11:15 UTC (permalink / raw)
To: Richard Weinberger
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arch-u79uwXL29TY76Z2rM5mHXA,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
vgupta-HKixBCOQz3hWk0Htik3J/w, catalin.marinas-5wv7dgnIgG8,
will.deacon-5wv7dgnIgG8, hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w,
egtvedt-BrfabpQBY5qlHtIdYg32fQ, vapier-aBrp7R+bbdUdnm+yROfE0A,
msalter-H+wXaHxf7aLQT0dZR+AlfA, a-jacquiot-l0cyMroinI0,
starvik-VrBV9hrLPhE, jesper.nilsson-VrBV9hrLPhE,
dhowells-H+wXaHxf7aLQT0dZR+AlfA, rkuo-sgV2jX0FEOL9JmXXK+q4OQ,
tony.luck-ral2JQCrhuEAvxtiuMwx3w,
fenghua.yu-ral2JQCrhuEAvxtiuMwx3w, takata-TMSiXQfHlQjsTix1lMzHGQ,
geert-Td1EMuHUCqxL1ZNQvxDV9g, monstr-pSz03upnqPeHXe+LvDLADg,
yasutake.koichi-NAum8xwdG0+S7A1Ibl2khg,
ralf-6z/3iImG2C8G8FEW9MqTrA, jonas-A9uVI2HLR7kOP4wsBPIw7w,
jejb-6jwH94ZQLHl74goWV3ctuw, deller-Mmb7MZpHnFY,
benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r,
paulus-eUNUBHrolfbYtjvyW6yDsg, schwidefsky-tA70FqPdS9bQT0dZR+AlfA,
heiko.carstens-tA70FqPdS9bQT0dZR+AlfA,
liqin.linux-Re5JQEeQqe8AvxtiuMwx3w,
lennox.wu-Re5JQEeQqe8AvxtiuMwx3w, cmetcalf-kv+TWInifGbQT0dZR+AlfA,
gxt-TG0Ac1+ktVePQbnJrJN+5g, linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, oleg
[-- 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 --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 12/44] metag: Use get_signal() signal_setup_done()
2014-03-03 11:15 ` [PATCH 12/44] metag: Use get_signal() signal_setup_done() James Hogan
@ 2014-03-18 11:41 ` James Hogan
0 siblings, 0 replies; 2+ messages in thread
From: James Hogan @ 2014-03-18 11:41 UTC (permalink / raw)
To: Richard Weinberger
Cc: linux-kernel, linux-arch, viro, vgupta, catalin.marinas,
will.deacon, hskinnemoen, egtvedt, vapier, msalter, a-jacquiot,
starvik, jesper.nilsson, dhowells, rkuo, tony.luck, fenghua.yu,
takata, geert, monstr, yasutake.koichi, ralf, jonas, jejb, deller,
benh, paulus, schwidefsky, heiko.carstens, liqin.linux, lennox.wu,
cmetcalf, gxt, linux-xtensa, akpm, oleg
[-- 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 --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-18 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1393804646-7797-1-git-send-email-richard@nod.at>
[not found] ` <1393804646-7797-2-git-send-email-richard@nod.at>
[not found] ` <1393804646-7797-2-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
2014-03-03 11:15 ` [PATCH 12/44] metag: Use get_signal() signal_setup_done() James Hogan
2014-03-18 11:41 ` James Hogan
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).