lkml.org 
[lkml]   [2011]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Floating point usage inside kernel
On 11/25/2011 08:16 AM, Nuno Santos wrote:
> Hi Jiri,
>
> Thanks for your reply.
>
> The algorithm is a matrix transform computation to make a affine a
> geometric transform.
>
> Basicly it is based on the following functions:
>
> http://pastebin.com/YHzYuLPU
>
> Curiously I ran a test before writing this email and guest what.... is
> working!! :)
>
> But now that I have opened this question here I should ask... is it safe?

[...]

> I'm not protecting the call to the function with kernel_fpu_begin and
> kernel_fpu_end

It's not safe even if you do protect it with kernel_fpu_begin. On
x86-64, a userspace process that mucks with MXCSR can trivially cause
you to oops even if you use kernel_fpu_begin. (I'm pretty sure x86-32
has a similar issue, and I imagine that other architectures have related
issues.) This might change someday, but there are exactly zero use
cases outside staging, so don't hold your breath.

--Andy


\
 
 \ /
  Last update: 2011-11-28 05:09    [W:0.094 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site