linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Roger Larsson <roger.larsson@norran.net>
To: linuxppc-embedded@ozlabs.org
Subject: Re: Help Needed: floating point used in kernel (task=c0398410, pc=3184)
Date: Wed, 24 May 2006 08:50:24 +0200	[thread overview]
Message-ID: <200605240850.24333.roger.larsson@norran.net> (raw)
In-Reply-To: <20060524061205.53935.qmail@web8405.mail.in.yahoo.com>

On onsdag 24 maj 2006 08.12, sandeep malik wrote:
> Hi All...
>
>   I am trying to run an application compiled with gcc toolchain gcc--3.4.3
> and glibc -2.3.4 on PPC 8325 board running Linux 2.6.11....but some how I
> am getting following error....
>
>   floating point used in kernel (task=c0398410, pc=3184)
>   floating point used in kernel (task=c0398410, pc=3184)
>   floating point used in kernel (task=c0398410, pc=3184)
>   floating point used in kernel (task=c0398410, pc=3184)
>   floating point used in kernel (task=c0398410, pc=3184)
>   floating point used in kernel (task=c0398410, pc=3184)
>
>   I was suspecting this error might be because the hardware is not
> supporting floating point operations and hence i tried a simple program in
> which I intentionally did some floating point operation but that program
> was running as expected. 
No, the warning is more serious than that.

Linux does not save floating point registers when entering kernel.
It might even optimize not to store/reload when doing a context switch.

If your kernel module is using floating point in your kernel code.
It will probably work on a processor not having floating point but will
break in mysterious ways on one supporting hardware floating point.

Do not use floating point in kernel. If you still have to you must take
extremely care.
  Turn off kernel preemption.
  Save FP registers.
  Do your stuff.
  Reload FP registers.
  Turn on preemption.
But the question is why would you have to?
Simple calculations can be done in fixed point, and complex calculations
does not belong in the kernel.

/RogerL

  reply	other threads:[~2006-05-24  7:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24  6:12 Help Needed: floating point used in kernel (task=c0398410, pc=3184) sandeep malik
2006-05-24  6:50 ` Roger Larsson [this message]
2006-05-24 18:03   ` Carlos Munoz
  -- strict thread matches above, loose matches on Subject: below --
2006-05-24  6:26 Help Needed: floating point used in kernel (task=c0398410, pc =3184) Liu Dave-r63238
2006-05-26  7:45 ` sandeep malik
2006-05-24  8:14 Re:Help Needed: floating point used in kernel (task=c0398410, pc=3184) sandeep malik
2006-05-24  9:48 ` Help " Roger Larsson
2006-05-24 12:30   ` sandeep malik
     [not found] <20060526073815.32337.qmail@web8401.mail.in.yahoo.com>
2006-05-26  7:49 ` Roger Larsson
2006-05-26 14:00   ` sandeep malik

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=200605240850.24333.roger.larsson@norran.net \
    --to=roger.larsson@norran.net \
    --cc=linuxppc-embedded@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).