All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>,
	Tschaeche IT-Services <services@domain.hid>
Subject: Re: [Xenomai-core] [RFC] Break out of endless user space loops
Date: Thu, 03 Jun 2010 10:27:26 +0200	[thread overview]
Message-ID: <1275553646.18250.65.camel@domain.hid> (raw)
In-Reply-To: <4C0751FC.8050009@domain.hid>

On Thu, 2010-06-03 at 08:55 +0200, Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
> > Jan Kiszka wrote:
> >> Hi all,
> >>
> >> here is the first apparently working prototype for getting hold of
> >> endless user space loops in RT threads. A simple test case of mine now
> >> receive a SIGDEBUG even if it does "while (1);".
> >>
> >> The design follows Gilles' suggestion to force a SEGV on victim thread
> >> but restore the patched PC before migrating the thread after this fault.
> >> The only drawback of this approach: We need to keep track of the
> >> preempted register set at I-pipe level. I basically replicated what
> >> Linux does these days as well and exported it as ipipe_get_irq_regs()
> >> (the second patch).
> > 
> > You already have the regs in xnarch_fault_info.
> > 
> 
> We only pass this around for exceptions.

And for a good reason, exceptions are always delivered synchronously
upon receipt, not IRQs, given the deferred dispatching scheme. Your
ipipe_get_irq_regs interface is inherently broken for anything which is
not a wired-mode timer IRQ, since you could pass the caller a reference
to an unwound stack frame.

You have to resort to __ipipe_tick_regs, and obviously only use this in
the context of a timer-triggered code, like the watchdog handler, which
saves your day.

> 
> Jan
> 
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core


-- 
Philippe.




  reply	other threads:[~2010-06-03  8:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-02 17:19 [Xenomai-core] [RFC] Break out of endless user space loops Jan Kiszka
2010-06-02 17:30 ` Gilles Chanteperdrix
2010-06-03  6:55   ` Jan Kiszka
2010-06-03  8:27     ` Philippe Gerum [this message]
2010-06-03  8:47       ` Jan Kiszka
2010-06-03  9:56         ` Philippe Gerum
2010-06-03 10:18           ` Jan Kiszka
2010-06-03 10:47             ` Philippe Gerum
2010-06-03 10:52               ` Philippe Gerum
2010-06-03 10:59               ` Jan Kiszka
2010-06-02 20:58 ` Philippe Gerum
2010-06-03  6:56   ` Jan Kiszka
2010-06-09 10:41 ` [Xenomai-core] [PATCH] Mayday support (was: Re: [RFC] Break out of endless user space loops) Philippe Gerum
2010-06-09 13:38   ` [Xenomai-help] " Tschaeche IT-Services
2010-06-09 14:01     ` Philippe Gerum
2010-06-09 18:11   ` Tschaeche IT-Services
2010-06-18 23:11     ` [Xenomai-core] " Philippe Gerum
2010-06-24  9:22       ` [Xenomai-help] " Tschaeche IT-Services
2010-06-24  9:34         ` [Xenomai-core] [PATCH] Mayday support Jan Kiszka
2010-06-24 10:28         ` [Xenomai-core] [PATCH] Mayday support (was: Re: [RFC] Break out of endless user space loops) Philippe Gerum
2010-06-24 12:05   ` [Xenomai-core] [PATCH] Mayday support Jan Kiszka
2010-06-27 16:01     ` Philippe Gerum
2010-06-28 14:06       ` Jan Kiszka
2010-06-28 14:12         ` Philippe Gerum
2010-07-06 15:44         ` Philippe Gerum
2010-07-06 15:54           ` Jan Kiszka
2010-07-06 16:41             ` Philippe Gerum
2010-07-06 17:10               ` Jan Kiszka
2010-08-20 12:32     ` Jan Kiszka
2010-08-20 14:00       ` Philippe Gerum
2010-08-20 14:06         ` Jan Kiszka
2010-08-20 14:20           ` Philippe Gerum

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=1275553646.18250.65.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=services@domain.hid \
    --cc=xenomai@xenomai.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.