All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] I-pipe exception handling - a general model
Date: Thu, 26 Feb 2015 14:34:03 +0100	[thread overview]
Message-ID: <54EF20CB.2000300@siemens.com> (raw)
In-Reply-To: <20150224204801.GJ14148@hermes.click-hack.org>

On 2015-02-24 21:48, Gilles Chanteperdrix wrote:
> On Tue, Feb 24, 2015 at 09:29:43PM +0100, Jan Kiszka wrote:
>> On 2015-02-24 20:27, Gilles Chanteperdrix wrote:
>>> On Tue, Feb 24, 2015 at 08:10:02PM +0100, Jan Kiszka wrote:
>>>> Hi,
>>>>
>>>> let's try to express the steps in handling hardware exception under
>>>> I-pipe in a generic way:
>>>>
>>>> ipipe_exception_handler(regs, ...)
>>>> {
>>>> 	// ARM has this e.g.
>>>> 	[if (early_handling(...))
>>>> 		return;]
>>>>
>>>> 	// some architectures may only enter with irqs off
>>>> 	[hard_irqs_off = hard_irqs_disabled();]
>>>
>>> Not OK. Here what you will get is:
>>> - hard_irqs_off is true if the exception is taken on root
>>> - hard_irqs_off is false if the exception is taken on head (as a
>>
>> No, this is invariant of the context. The hardware(-configuration)
>> decides if we enter the handler with hard irqs off or not. See x86, this
>> is known to work code.
> 
> No. Relaxing re-enables hw irqs. So, if you took the exception over
> head, you relaxed, and hw irqs are on here. The information you get
> this way is irrelevant.

ipipe_exception_handler() is supposed to be the function that the
assembly exception trampoline calls directly - there can't be any
migration/relaxation before that. Thus, hard_irqs_disabled() reflects if
the exception handler was called by the hardware with hard interrupts on
or off.

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux


  reply	other threads:[~2015-02-26 13:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 19:10 [Xenomai] I-pipe exception handling - a general model Jan Kiszka
2015-02-24 19:27 ` Gilles Chanteperdrix
2015-02-24 20:29   ` Jan Kiszka
2015-02-24 20:48     ` Gilles Chanteperdrix
2015-02-26 13:34       ` Jan Kiszka [this message]
2015-02-24 20:38 ` Philippe Gerum
2015-02-24 20:52   ` Gilles Chanteperdrix

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=54EF20CB.2000300@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.