All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linaro-toolchain@lists.linaro.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Martin Schwidefsky <martin.schwidefsky@de.ibm.com>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Tejun Heo <tj@kernel.org>
Subject: Re: try_to_freeze() called with IRQs disabled on ARM
Date: Fri, 2 Sep 2011 18:48:12 +0100	[thread overview]
Message-ID: <20110902174812.GD6619@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <OFA88E54BC.55310B1A-ONC12578FF.00607E64-C12578FF.00611957@de.ibm.com>

On Fri, Sep 02, 2011 at 07:40:34PM +0200, Ulrich Weigand wrote:
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote on 09/02/2011
> 07:22:59 PM:
> > On Fri, Sep 02, 2011 at 04:47:35PM +0200, Ulrich Weigand wrote:
> > > Assume the scenario you initally describe, where a first signal is
> > > ignored and leads to system call restart.  With your latest patch,
> > > you call into syscall_restart which sets everything up to restart
> > > the call (with interrupts disabled).
> >
> > I don't think SIG_IGN signals even set the TIF work flag, so they
> > never even cause a call into do_signal().  Therefore, as far as
> > syscalls go, attempting to send a process (eg) a SIGINT which its
> > handler is set to SIG_IGN results in the process not even being
> > notified about the attempt - we won't even wake up while the
> > syscall is sleeping.
> 
> I don't see why SIG_IGN signals shouldn't set the TIF work flag;
> the decision whether to ignore a signal is only made once we've
> got to get_signal_to_deliver.

Yes, having looked deeper, you seem to be right - but only if the thread
is being ptraced.  If it's not being ptraced, ignored signals don't
make it that far.

And yes, we can end up processing the interrupt before the SVC is
executed, which is still a hole.  So we need to avoid doing the
restart in userspace - which might actually make things easier.
I'll take a look into that over the weekend.

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: try_to_freeze() called with IRQs disabled on ARM
Date: Fri, 2 Sep 2011 18:48:12 +0100	[thread overview]
Message-ID: <20110902174812.GD6619@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <OFA88E54BC.55310B1A-ONC12578FF.00607E64-C12578FF.00611957@de.ibm.com>

On Fri, Sep 02, 2011 at 07:40:34PM +0200, Ulrich Weigand wrote:
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote on 09/02/2011
> 07:22:59 PM:
> > On Fri, Sep 02, 2011 at 04:47:35PM +0200, Ulrich Weigand wrote:
> > > Assume the scenario you initally describe, where a first signal is
> > > ignored and leads to system call restart.  With your latest patch,
> > > you call into syscall_restart which sets everything up to restart
> > > the call (with interrupts disabled).
> >
> > I don't think SIG_IGN signals even set the TIF work flag, so they
> > never even cause a call into do_signal().  Therefore, as far as
> > syscalls go, attempting to send a process (eg) a SIGINT which its
> > handler is set to SIG_IGN results in the process not even being
> > notified about the attempt - we won't even wake up while the
> > syscall is sleeping.
> 
> I don't see why SIG_IGN signals shouldn't set the TIF work flag;
> the decision whether to ignore a signal is only made once we've
> got to get_signal_to_deliver.

Yes, having looked deeper, you seem to be right - but only if the thread
is being ptraced.  If it's not being ptraced, ignored signals don't
make it that far.

And yes, we can end up processing the interrupt before the SVC is
executed, which is still a hole.  So we need to avoid doing the
restart in userspace - which might actually make things easier.
I'll take a look into that over the weekend.

  reply	other threads:[~2011-09-02 17:51 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 15:19 try_to_freeze() called with IRQs disabled on ARM Mark Brown
2011-08-23 15:19 ` Mark Brown
2011-08-23 15:43 ` Russell King - ARM Linux
2011-08-23 15:43   ` Russell King - ARM Linux
2011-08-23 22:08   ` Rafael J. Wysocki
2011-08-23 22:08     ` Rafael J. Wysocki
2011-08-23 21:51 ` Rafael J. Wysocki
2011-08-23 21:51   ` Rafael J. Wysocki
2011-08-23 21:53   ` Tejun Heo
2011-08-23 21:53     ` Tejun Heo
2011-08-23 22:00     ` Russell King - ARM Linux
2011-08-23 22:00       ` Russell King - ARM Linux
2011-08-23 22:08       ` Tejun Heo
2011-08-23 22:08         ` Tejun Heo
2011-08-23 22:13         ` Russell King - ARM Linux
2011-08-23 22:13           ` Russell King - ARM Linux
2011-08-23 22:17           ` Tejun Heo
2011-08-23 22:17             ` Tejun Heo
2011-08-23 22:35             ` Tejun Heo
2011-08-23 22:35               ` Tejun Heo
2011-08-24 23:15               ` Rafael J. Wysocki
2011-08-24 23:15                 ` Rafael J. Wysocki
2011-08-25 12:14             ` Russell King - ARM Linux
2011-08-25 12:14               ` Russell King - ARM Linux
2011-08-25 12:17               ` Tejun Heo
2011-08-25 12:17                 ` Tejun Heo
2011-08-25 12:25                 ` Russell King - ARM Linux
2011-08-25 12:25                   ` Russell King - ARM Linux
2011-08-25 12:35                   ` Tejun Heo
2011-08-25 12:35                     ` Tejun Heo
2011-08-25 13:04                     ` Russell King - ARM Linux
2011-08-25 13:04                       ` Russell King - ARM Linux
2011-08-25 13:09                       ` Tejun Heo
2011-08-25 13:09                         ` Tejun Heo
2011-08-25 14:55                         ` Russell King - ARM Linux
2011-08-25 14:55                           ` Russell King - ARM Linux
2011-08-26 14:44                           ` Arnd Bergmann
2011-08-26 14:44                             ` Arnd Bergmann
2011-09-01 13:41                             ` Ulrich Weigand
2011-09-01 13:41                               ` Ulrich Weigand
2011-09-01 14:00                               ` Russell King - ARM Linux
2011-09-01 14:00                                 ` Russell King - ARM Linux
2011-09-02 14:47                                 ` Ulrich Weigand
2011-09-02 14:47                                   ` Ulrich Weigand
2011-09-02 17:22                                   ` Russell King - ARM Linux
2011-09-02 17:22                                     ` Russell King - ARM Linux
2011-09-02 17:40                                     ` Ulrich Weigand
2011-09-02 17:40                                       ` Ulrich Weigand
2011-09-02 17:48                                       ` Russell King - ARM Linux [this message]
2011-09-02 17:48                                         ` Russell King - ARM Linux
2011-09-16 10:31                                         ` Martin Schwidefsky
2011-09-16 10:31                                           ` Martin Schwidefsky
2011-09-27 17:45                                         ` Ulrich Weigand
2011-09-27 17:45                                           ` Ulrich Weigand
2011-08-30 20:58                           ` Mark Brown
2011-08-30 20:58                             ` Mark Brown
2011-08-30 21:10                             ` Russell King - ARM Linux
2011-08-30 21:10                               ` Russell King - ARM Linux
2012-06-26 16:39                           ` Mandeep Singh Baines
2012-06-26 16:39                             ` Mandeep Singh Baines
2012-06-26 17:16                             ` Russell King - ARM Linux
2012-06-26 17:16                               ` Russell King - ARM Linux
2011-08-23 22:13     ` Rafael J. Wysocki
2011-08-23 22:13       ` Rafael J. Wysocki
2011-08-25 11:37   ` Mark Brown
2011-08-25 11:37     ` Mark Brown

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=20110902174812.GD6619@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linaro-toolchain@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.schwidefsky@de.ibm.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=rjw@sisk.pl \
    --cc=tj@kernel.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 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.