All of lore.kernel.org
 help / color / mirror / Atom feed
From: "François Legal" <devel@thom.fr.eu.org>
To: xenomai@xenomai.org
Subject: Re: Strange switching [threadname] to  secondary mode after exception #0 in kernel-space at 0x80272444
Date: Wed, 14 Oct 2020 10:43:38 +0200	[thread overview]
Message-ID: <1175-5f86ba00-b9-25a5a500@198941922> (raw)
In-Reply-To: <1174-5f74a080-4b-37e14c00@201458726>

Anybody can help on this ?

François

Le Mercredi, Septembre 30, 2020 17:14 CEST, François Legal via Xenomai <xenomai@xenomai.org> a écrit:

> So the problem here lies in the calls to rtnet_get_arg(fd, &_msg, msg, sizeof(*msg)); in af_packet.c sendmasg/recvmsg
>
> The only explanation I could find was that, for my architecture (32bit ARMv7), syscall use the COBALT_SYSCALL32emu variants for sendmsg/recvmsg calls, which in turn allocate a struct user_msghdr on the SVC stack, then calls rt_packet_sendmsg/rt_packet_recvmsg with the address of that struct.
>
> Then, rtnet_get_arg would invoke arm_copy_from_user, which, with SPECTRE mitigation turned on (you normally can't disable this by configuration), would check that the source pointer is in the userland memory area, and hence fail in my case.
>
> Going from there, except disabling SPECTRE mitigation, I'm not sure how I can fix this.
>
> François
>
> Le Mercredi, Septembre 30, 2020 10:48 CEST, François Legal via Xenomai <xenomai@xenomai.org> a écrit:
>
> > I might have found what is causing this problem : CONFIG_CPU_SPECTRE
> >
> > It was the noticeable difference between my last (4.4.189) kernel release not showing this problem, and the next I tried (4.4.227).
> > If I modify the Kconfig to disable CPU_SPECTRE, the problem does not show up anymore.
> >
> > I'll dig a little deeper into that now.
> >
> > François
> >
> > Le Mercredi, Septembre 30, 2020 08:42 CEST, François Legal <francois.legal@thom.fr.eu.org> a écrit:
> >
> > > So I decided to dig a little deeper in this problem, and found out that it is not xenomai3.1 specific.
> > > I tried with xenomai-3.0.9 and linux 4.4.227 -> same problem.
> > > I thought it might be a matter of ipipe patch not quite fit to 4.4.227, so I decided to try with latest ipipe-4.4.y-cip from git and xenomai 3.0.9, but the same problem happens.
> > >
> > > François
> > >
> > > Le Vendredi, Septembre 25, 2020 18:11 CEST, François Legal via Xenomai <xenomai@xenomai.org> a écrit:
> > >
> > > > Sorry to come back so late on that topic.
> > > > I took some time to write a simple test program, which is attached.> >
> > > > Config is as follows :
> > > > xenomai-3.1
> > > > linux-4.4.227
> > > >
> > > > François
> > > >
> > > > Le Vendredi, Août 21, 2020 20:04 CEST, Jan Kiszka <jan.kiszka@siemens.com> a écrit:
> > > >
> > > > > On 20.08.20 15:46, François Legal via Xenomai wrote:
> > > > > > Using RTNet with multiple interfaces, xenomai 3.1 with linux 4.4
> > > > > > Whenever a posix RT thread calls recvmsg (), I get this error.
> > > > > >
> > > > > > I could track this down to line 422 in udp.c :     msg = rtnet_get_arg(fd, &_msg, u_msg, sizeof(_msg));
> > > > > >
> > > > > > If I disassemble the kernel, the failing instruction (at 0x80272444) is a nop in arm_copy_from_user
> > > > > > Am I doing anything wrong ?
> > > > >
> > > > > Maybe you are passing an invalid pointer to recvmsg, directly or in its
> > > > > message structures. That would cause an exception which is fixed up but
> > > > > also reported. Do you get an error in return?
> > > > >
> > > > > Jan
> > > > >
> > > > > --
> > > > > Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> > > > > Corporate Competence Center Embedded Linux
> > > > -------------- next part --------------
> > > > A non-text attachment was scrubbed...
> > > > Name: test-net.c
> > > > Type: application/octet-stream
> > > > Size: 6141 bytes
> > > > Desc: not available
> > > > URL: <http://xenomai.org/pipermail/xenomai/attachments/20200925/f745e32f/attachment.obj>
> > >
> >
> >
>
>



  reply	other threads:[~2020-10-14  8:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 13:46 Strange switching [threadname] to secondary mode after exception #0 in kernel-space at 0x80272444 François Legal
2020-08-21 18:04 ` Jan Kiszka
2020-08-24  9:44   ` François Legal
2020-08-24 11:28     ` Jan Kiszka
2020-09-25 16:11   ` François Legal
2020-09-30  6:42     ` François Legal
2020-09-30  8:48       ` François Legal
2020-09-30 15:14         ` François Legal
2020-10-14  8:43           ` François Legal [this message]
2020-10-14  9:37             ` Jan Kiszka
2020-10-14 14:16               ` Greg Gallagher
2020-10-16  7:14                 ` François Legal
2020-10-16  8:59                   ` Philippe Gerum
2020-10-16  9:45                     ` François Legal
2020-10-16 12:03                       ` Philippe Gerum
2020-10-16 14:05                         ` François Legal
2020-10-16 16:24                           ` Philippe Gerum
2020-10-19  6:17                             ` François Legal
2020-10-31 16:48                               ` Philippe Gerum
2020-11-02  8:08                                 ` François Legal
2020-11-20 16:06                                   ` François Legal
2020-12-03 13:52                                     ` Philippe Gerum
2020-10-22 12:22                             ` François Legal

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=1175-5f86ba00-b9-25a5a500@198941922 \
    --to=devel@thom.fr.eu.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.