From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>,
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Mayday issues again
Date: Wed, 08 Jul 2015 14:52:59 +0200 [thread overview]
Message-ID: <559D1D2B.3080704@siemens.com> (raw)
In-Reply-To: <559D1B05.9010503@xenomai.org>
On 2015-07-08 14:43, Philippe Gerum wrote:
> On 07/08/2015 02:33 PM, Jan Kiszka wrote:
>> On 2015-07-08 14:32, Gilles Chanteperdrix wrote:
>>> On Wed, Jul 08, 2015 at 02:24:41PM +0200, Jan Kiszka wrote:
>>>> On 2015-07-08 13:56, Philippe Gerum wrote:
>>>>> On 07/08/2015 12:31 PM, Jan Kiszka wrote:
>>>>>> On 2015-07-07 14:53, Philippe Gerum wrote:
>>>>>>> On 07/07/2015 11:27 AM, Philippe Gerum wrote:
>>>>>>>> I tested the patch on ARM. Enabling IPIPE_DEBUG_INTERNAL there reveals a
>>>>>>>> bug with the mayday handler now turning hw IRQs on, as a result of
>>>>>>>> relaxing over the low level IRQ trampoline, which makes some I-pipe call
>>>>>>>> in the irq_handler boilerplate code unhappy. The very same issue is
>>>>>>>> looming on x86, with an unprotected call to __ipipe_root_p from
>>>>>>>> __ipipe_handle_irq(). Disabling IRQs before leaving the mayday handler
>>>>>>>> is required at the very least.
>>>>>>>>
>>>>>>>
>>>>>>> Looking further, ARM is affected because it does not invoke
>>>>>>> __ipipe_call_mayday() for triggering the mayday trap, but still uses the
>>>>>>> open-coded method. This routine preserves the current hw state across
>>>>>>> the trap, which should make x86 safe in the end.
>>>>>>
>>>>>> Which kernel version are you testing? It's not reproducing on 3.14 for
>>>>>> Cortex-A7/15 targets at least. And I find __ipipe_call_mayday in both
>>>>>> 3.14 and 3.18 (fastcall_exit_check).
>>>>>>
>>>>>
>>>>> Looking at the code, any kernel version since 3.10 will have the same
>>>>> issue, older ones likely too, tested on 3.18.12. This does not depend on
>>>>> the ARM target.
>>>>>
>>>>> irq_handler from entry-armv.S:
>>>>> => __ipipe_grab_irq (or indirecty via ipipe_handle_multi_irq with
>>>>> MULTI_IRQ enabled)
>>>>> => __ipipe_exit_irq (open coded __ipipe_notify_trap(MAYDAY),
>>>>> xnthread_relax() re-enables hw IRQs)
>>>>> => __ipipe_check_root_interruptible (from irq_handler)
>>>>> BAD: __ipipe_root_p tested with CPU migration enabled
>>>>>
>>>>
>>>> Maybe [1] makes the difference here? I think I had to fix this for a
>>>> different reason.
>>>
>>> Except this does not work over legacy kernel thread stacks..
>>
>> Xenomai 2 is out of scope for these changes on mayday and for gdb
>> improvements.
>>
>
> Testing CONFIG_IPIPE_LEGACY for such change would be required then.
Do you mean if I can access preempt_count() in
__ipipe_check_percpu_access? We are over the root domain at that point,
thus legacy RT kernel threads are implicitly excluded, no?
Otherwise, the changes affect only the Xenomai 3 code base anyway.
Jan
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2015-07-08 12:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 14:34 [Xenomai] Mayday issues again Jan Kiszka
2015-06-20 14:46 ` Gilles Chanteperdrix
2015-06-20 15:01 ` Jan Kiszka
2015-06-20 18:15 ` Philippe Gerum
2015-06-21 17:53 ` Jan Kiszka
2015-06-21 18:57 ` Philippe Gerum
2015-07-07 9:27 ` Philippe Gerum
2015-07-07 12:53 ` Philippe Gerum
2015-07-07 13:01 ` Jan Kiszka
2015-07-07 13:24 ` Philippe Gerum
2015-07-08 10:31 ` Jan Kiszka
2015-07-08 11:56 ` Philippe Gerum
2015-07-08 12:24 ` Jan Kiszka
2015-07-08 12:29 ` Philippe Gerum
2015-07-08 12:32 ` Gilles Chanteperdrix
2015-07-08 12:33 ` Jan Kiszka
2015-07-08 12:43 ` Philippe Gerum
2015-07-08 12:52 ` Jan Kiszka [this message]
2015-07-08 13:00 ` Philippe Gerum
2015-07-08 13:04 ` Jan Kiszka
2015-07-08 13:10 ` 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=559D1D2B.3080704@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=rpm@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.