All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>, Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Mayday mechanism broken on x86-64 - simpler approach feasible?
Date: Thu, 12 Feb 2015 18:45:58 +0100	[thread overview]
Message-ID: <54DCE6D6.7060305@siemens.com> (raw)
In-Reply-To: <54DCE08F.6050304@siemens.com>

On 2015-02-12 18:19, Jan Kiszka wrote:
> On 2015-02-12 18:18, Philippe Gerum wrote:
>> On 02/12/2015 06:16 PM, Jan Kiszka wrote:
>>> On 2015-02-12 18:07, Philippe Gerum wrote:
>>>> On 02/12/2015 06:02 PM, Jan Kiszka wrote:
>>>>> On 2015-02-12 17:36, Jan Kiszka wrote:
>>>>>>> As I mentioned earlier, I'd rather fix the MAYDAY implementation for
>>>>>>> x86_64 instead of forking the implementation between MMU-enabled and
>>>>>>> MMU-less architectures, also affecting powerpc, arm and x86_32 in the
>>>>>>> same move. Fortunately, the current implementation allows very specific
>>>>>>> tweaks to be applied on a per-architecture basis. This one fixes the
>>>>>>> issue for Cobalt on x86_64, and could be easily backported to 2.6.x:
>>>>>>>
>>>>>>> http://git.xenomai.org/xenomai-3.git/commit/?h=next&id=6db20901963d634b9786467c711c2ba526db48a2
>>>>>>
>>>>>> Looks almost good - except for the detail that some bits of the
>>>>>> instruction pointer are lost on return from the syscall (int vs. long
>>>>>> return type). Patches in the making.
>>>>>
>>>>> Will take longer - I need to convert all cobalt syscalls.
>>>>>
>>>>> We have a sleeping bug there, though likely not seen in practice, with
>>>>> syscalls returning values > INT_MAX (size_t...). The problem is that
>>>>> handle_head/root_syscall only forwarded 32-bits so far.
>>>>>
>>>>
>>>> You mean this, and all the implications of it?
>>>>
>>>> diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
>>>> index 6a9a02c..99b86a4 100644
>>>> --- a/kernel/cobalt/posix/syscall.c
>>>> +++ b/kernel/cobalt/posix/syscall.c
>>>> @@ -73,9 +73,9 @@
>>>>  /* Shorthand for oneway trap - does not return to call site. */
>>>>  #define __xn_exec_oneway    __xn_exec_norestart
>>>>
>>>> -typedef int (*cobalt_syshand)(unsigned long arg1, unsigned long arg2,
>>>> -			      unsigned long arg3, unsigned long arg4,
>>>> -			      unsigned long arg5);
>>>> +typedef long (*cobalt_syshand)(unsigned long arg1, unsigned long arg2,
>>>> +			       unsigned long arg3, unsigned long arg4,
>>>> +			       unsigned long arg5);
>>>>
>>>>  static void prepare_for_signal(struct task_struct *p,
>>>>  			       struct xnthread *thread,
>>>>
>>>
>>> Exactly.
>>>
>>> Just done with the mechanics, crossing fingers it won't break things subtly.
>>>
>>
>> Ok. While we are at it, we should get rid of the syscall return type in
>> the COBALT_SYSCALL[_DECL] macro helpers, this is pointless.
> 
> Jep, that's what I did - hard-wired it to long.
> 
> First tests look good, just need to split things up into 3 or 4 patches now.

Done, see my for-forge branch.

Jan

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


  reply	other threads:[~2015-02-12 17:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 16:57 [Xenomai] Mayday mechanism broken on x86-64 - simpler approach feasible? Jan Kiszka
2014-12-17 17:19 ` Philippe Gerum
2014-12-17 17:17   ` Gilles Chanteperdrix
2014-12-17 17:36     ` Jan Kiszka
2014-12-17 17:45       ` Gilles Chanteperdrix
2014-12-17 17:49         ` Jan Kiszka
2014-12-17 17:37   ` Jan Kiszka
2014-12-17 17:52 ` Philippe Gerum
2014-12-17 17:46   ` Jan Kiszka
2014-12-17 18:28     ` Philippe Gerum
2014-12-17 18:32       ` Jan Kiszka
2014-12-17 18:33         ` Jan Kiszka
2014-12-17 18:55         ` Philippe Gerum
2014-12-17 18:57           ` Jan Kiszka
2015-02-03 15:29           ` Philippe Gerum
2015-02-12 16:36             ` Jan Kiszka
2015-02-12 17:01               ` Philippe Gerum
2015-02-12 17:02               ` Jan Kiszka
2015-02-12 17:07                 ` Philippe Gerum
2015-02-12 17:16                   ` Jan Kiszka
2015-02-12 17:18                     ` Philippe Gerum
2015-02-12 17:19                       ` Jan Kiszka
2015-02-12 17:45                         ` Jan Kiszka [this message]
2015-02-16 17:37                           ` Jan Kiszka
2015-02-16 17:43                             ` Philippe Gerum
2015-02-17 10:58                               ` 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=54DCE6D6.7060305@siemens.com \
    --to=jan.kiszka@siemens.com \
    --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.