Subject: Re: Using Floating Point in kernel... is bad, okay?
To: Bill Stouder-Studenmund <wrstuden@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 06/15/2007 07:45:00
On Thu, Jun 14, 2007 at 11:25:29PM -0700, Bill Stouder-Studenmund wrote:
> No. The problem is that, strictly speaking, the FP state-saving code is FP 
> code in the kernel. :-) Maybe we could special-case it (maybe we already 
> special case it, I'm not sure) so state-saving would be fine.
> 
> A more reasonable option, I think, would be to optionally disable the FP 
> unit at the start of each system call. While we wouldn't catch FP use in 
> interrupt handlers, we'd cover most of the kernel.
> 
> I think it should not be part of DIAGNOSTIC though. I think it would be a 
> very performance intensive operation, as now every FP operation that 
> follows a system call triggers a trap.

Would it just involve setting the 'trap on FP instruction' bit on
syscall entry, and removing it on syscall exit if the FP state is
that for the current process. Instead of setting it on syscall exit
if the current process doesn't have the FP ?

	David

-- 
David Laight: david@l8s.co.uk