From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: rwestman@telia.com (Rickard Westman)
Cc: linux-kernel@vger.kernel.org
Subject: Re: Using kernel_fpu_begin() in device driver - feasible or not?
Date: Thu, 14 Feb 2002 13:47:23 +0000 (GMT) [thread overview]
Message-ID: <E16bMEO-0008Up-00@the-village.bc.nu> (raw)
In-Reply-To: <3C6B00B3.6000602@telia.com> from "Rickard Westman" at Feb 14, 2002 01:11:31 AM
> 1. Would it be sufficient to just bracket all fpu-using code code by
> kernel_fpu_begin()/kernel_fpu_end()? If not, what problems could I
> run into?
You can do that providing you dont
> 2. Would it be OK to go to sleep inside such a region, or should I
> take care to avoid that?
You can't sleep in such a region - there is nowhere left to store the
FPU context
> 3. Perhaps I should call init_fpu() at some point as well? If so,
> should it be done before or after kernel_fpu_begin()?
After
> 4. Is there any difference between doing this in the context of a user
> process (implementation of an ioctl) compared to doing it in a
> daemonized kernel thread (created by a loadable kernel module)?
The kernel thread is actually easier, you can happily corrupt its user
FPU context by sleeping since you are the only FPU user for the thread.
Not nice, not portable but should work fine on x86 without any of the
above for the moment.
You should probably also test the FPU is present and handle it accordingly
with polite messages not an oops 8)
next prev parent reply other threads:[~2002-02-14 13:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-14 0:11 Rickard Westman
2002-02-14 13:47 ` Alan Cox [this message]
2002-02-14 14:18 ` Alan Cox
2002-02-14 14:20 ` Steffen Persvold
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=E16bMEO-0008Up-00@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rwestman@telia.com \
/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
all inboxes | Powered by JetHome®