From: Sagi Maimon <SMaimon@advaoptical.com>
To: Jouko Haapaluoma <jouko.haapaluoma@wapice.com>,
"xenomai@xenomai.org" <xenomai@xenomai.org>,
"Philippe Gerum <rpm@xenomai.org> (rpm@xenomai.org)"
<rpm@xenomai.org>
Cc: Adnan Ali <adnan.ali@wapice.com>,
Sakari Junnila <sakari.junnila@wapice.com>
Subject: Re: [Xenomai] Unrecoverable FP Unavailable Exception 801
Date: Wed, 25 Apr 2018 10:03:49 +0000 [thread overview]
Message-ID: <f8dcb04851eb41f999146f02ae552dd3@advaoptical.com> (raw)
In-Reply-To: <b2cbe5362c38461d9a2eb817b78fb633@EDB3.wapice.localdomain>
Thanks a lot Jouko, I will try your fix.
-----Original Message-----
From: Jouko Haapaluoma [mailto:jouko.haapaluoma@wapice.com]
Sent: Wednesday, April 25, 2018 11:55
To: Sagi Maimon <SMaimon@advaoptical.com>; xenomai@xenomai.org; Philippe Gerum <rpm@xenomai.org> (rpm@xenomai.org) <rpm@xenomai.org>
Cc: Adnan Ali <adnan.ali@wapice.com>; Sakari Junnila <sakari.junnila@wapice.com>
Subject: RE: [Xenomai] Unrecoverable FP Unavailable Exception 801
On Mon, Apr 02, 2018 at 12:56:39PM +0000, Sagi Maimon wrote:
> Hi all,
> I am working with: Powerpc e300 SOC.
> I am using: xenomai-2.6.4 version
>
> I am experiencing this exception on my Linux :
> Unrecoverable FP Unavailable Exception 801 at c0003858
> Oops: Unrecoverable FP Unavailable Exception, sig: 6 [#1]
>
> This happens during "alignment exception" (600)
Hello
We have also seen this issue recently with Xenomai 2.6.4 and i-pipe 3.1.10-powerpc-2.13-06.
We have been investigating this and Adnan found that the issue seems to be in arch/powerpc/kernel/process.c: enable_kernel_fp().
In this function the irqs are disabled and enabled by calling local_irq_save_hw_cond() and local_irq_restore_hw_cond(). In between the FP bit is enabled and written to MSR in giveup_fpu(). However, the local_irq_restore_hw_cond() restores the previous MSR which does not have the FP bit enabled and this leads to the exception 801.
We have briefly tested that the exception 801 does not occur with the following patch:
--- a/arch/powerpc/kernel/process.c 2018-04-24 15:54:10.164558970 +0300
+++ b/arch/powerpc/kernel/process_new.c 2018-04-24 15:53:30.635567659 +0300
@@ -114,6 +114,11 @@ void enable_kernel_fp(void) #else
giveup_fpu(last_task_used_math);
#endif /* CONFIG_SMP */
+ /*
+ * giveup_fpu sets the FP bit in MSR, toggling it off would cause
+ * unavailable FP kernel panic. So, keep it on if it was set.
+ */
+ flags |= (mfmsr() & MSR_FP);
local_irq_restore_hw_cond(flags);
}
EXPORT_SYMBOL(enable_kernel_fp);
It seems that the implementation is quite similar also in the current I-pipe branch ipipe-4.9.y (only the FP bit is set by msr_check_and_set() and not in giveup_fpu). Therefore the problem seems to exist also in the latest i-pipe.
Is our fix correct or have we missed something?
BR,
Jouko Haapaluoma
Wapice Ltd
Finland
next prev parent reply other threads:[~2018-04-25 10:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.27.1522680894.4366.xenomai@xenomai.org>
2018-04-03 13:57 ` [Xenomai] Unrecoverable FP Unavailable Exception 801 Steven Seeger
2018-04-03 18:31 ` Lennart Sorensen
2018-04-03 18:34 ` Steven Seeger
2018-04-04 10:10 ` Sagi Maimon
2018-04-04 10:17 ` Sagi Maimon
2018-04-04 12:55 ` Seeger, Steven D. (GSFC-582.0)[Embedded Flight Systems, Inc]
2018-04-04 12:57 ` Sagi Maimon
2018-04-04 14:45 ` Lennart Sorensen
2018-04-04 14:53 ` Sagi Maimon
2018-04-04 15:25 ` Steven Seeger
2018-04-04 15:42 ` Sagi Maimon
2018-04-04 17:16 ` Steven Seeger
2018-04-25 8:54 ` Jouko Haapaluoma
2018-04-25 10:03 ` Sagi Maimon [this message]
2018-04-25 16:49 ` Philippe Gerum
2018-04-24 18:54 ` Steven Seeger
2018-04-30 3:21 ` Steven Seeger
2018-04-02 12:56 Sagi Maimon
2018-04-02 14:19 ` Philippe Gerum
2018-04-02 15:23 ` Lennart Sorensen
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=f8dcb04851eb41f999146f02ae552dd3@advaoptical.com \
--to=smaimon@advaoptical.com \
--cc=adnan.ali@wapice.com \
--cc=jouko.haapaluoma@wapice.com \
--cc=rpm@xenomai.org \
--cc=sakari.junnila@wapice.com \
--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.