lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Nov 2011 11:14:39 +0000
From:	Nuno Santos <nsantos@...gma.com>
To:	linux-kernel@...r.kernel.org
Subject: Floating point usage inside kernel

Hi,

This question has probably bean discussed for several times in this list 
but the information I found googling around is inconclusive to me.

I'm implementing a kernel input driver and I have successfully achieved 
my goal for at least 75%.

Since I understand that kernel floating point usage is discouraged I 
have converted most of my code to use integers. I knew that kernel 
floating point usage was already discouraged in Windows but could be 
done by saving floating point unit state.

However, there is a small part of my code that really needs floating 
point calculations and it's conversion to integer is not being trivial.

Since that part of the code is not done intensively and since I have 
already found information that leads me to believe that the same is 
possible, that is, saving fpu state and successfully achieve floating 
point calculation on kernel.

I found this article on the internet which deeply explains fpu usage in 
kernel:

http://www.linuxsmiths.com/blog/?p=253

As a conclusion, the article says that if we need to use floating point 
calculations in kernel, it is possible if we keep the state of the fpu 
unit with the following calls:

*/kernel_fpu_begin()
/**/kernel_fpu_end()

We also need to use the compiler flag -mhard-float

But when I compile I get:

error: implicit declaration of function ‘kernel_fpu_begin’ 
[-Werror=implicit-function-declaration]
error: implicit declaration of function ‘kernel_fpu_end’ 
[-Werror=implicit-function-declaration]

Doing a grep -r kernel_fpu_begin * on kernel source dir I can find 
several references to this functions but not them is included in the 
include dir. Which include do I need to have this functions found in 
compile time?

Am I even sailing in the right direction? Is this really possible or am 
I wasting my time?

I'm new to kernel programming and this is not a trivial issue for me. I 
hope you understand.

Thanks,

With my best regards,

Nuno Santos
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ