Subject: Re: DANGER WILL ROBINSON
To: None <colins@softimage.com, port-alpha@NetBSD.ORG>
From: Ross Harvey <ross@teraflop.com>
List: port-alpha
Date: 05/21/1998 10:27:30
> From port-alpha-owner-ross=teraflop.com@NetBSD.ORG Thu May 21 07:46:57 1998
> From: "colins" <colins@softimage.com>
> To: <port-alpha@NetBSD.ORG>
> Subject: DANGER WILL ROBINSON
> Date: Thu, 21 May 1998 10:29:35 -0400
>...
> While looking at my /var/log/messages I noticed this:
>
> /netbsd: DANGER WILL ROBINSON: FEN SET IN cpu_fork!
>
>...
>
> ok, now, what does that mean? 8-O

FEN is Floating ENable, it's supposed to be off in the kernel. This
way, the floating registers don't have to be saved and restored
just so a process can call gettimeofday(2) or take a clock interrupt.

In fact, it leaves it off when switching processes, so it doesn't
even have to save and restore the floating regs on context switch
unless and until a switched-to process starts doing some floating
point. (Which, unfortunately, is more often than you might think
thanks to gcc using fp regs in block move ops.) Anyway, then it
gets a trap, saves the fp regs of the old process, and restores
the regs of the new process.

Having said all that, no one knows why we get that warning (complaining
that FEN is set in the new process) when a blue moon occurs on a
tuesday.  I've read through all the related code and it certainly
seems to DTRT at each point. I think it might be related to swapout()
(soon to be uvm_swapout()). There is no known way to reproduce it,
and it seems like no actual harm has been done.

Ross Harvey