Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Apr 2001 10:36:29 -0800 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Mark Murray <mark@grondar.za>, current@FreeBSD.org, "David O'Brien" <obrien@FreeBSD.org>
Subject:   Re: i586 FP optimizations hosed.
Message-ID:  <XFMail.010402103629.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0103311623200.6249-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 31-Mar-01 Bruce Evans wrote:
> On Fri, 30 Mar 2001, John Baldwin wrote:
> 
>> On 30-Mar-01 David O'Brien wrote:
>> > On Fri, Mar 30, 2001 at 07:45:43AM +0200, Mark Murray wrote:
>> >> I thought the 586 FP stuff was disabled?
>> > 
>> > Nope.  Depending on how current you are, it was either left broken.
>> > I commited BDE's fix to exeception.s that fixed things for K6-2 users.
>> 
>> It looks like it is just broken in the SMP case.
> 
> It is more just broken than before in the SMP case.  Premptive context
> switching in the kernel did most of the breaking, and recent changes
> added sanity checks that detected a very broken case.  With preemptive
> context switching, the following can happen:
> 
> - we start using the FPU on a CPU with a free FPU (we used to free the
>   FPU in some cases; now we only use optimizations in bcopy/bzero if
>   the FPU was free to begin with).
> - we do a preemptive context switch and come back using a different FPU.
> 
> The different CPU might even be unfree, and that case is now detected.
> In other cases, we just corrupt data by using different FPU registers :-(.

Ugh.  Hrm, then we need to either disable interrupts inside of i586_* or set a
hard affinity flag in the process such that all other CPU's will ignore it and
only p_lastcpu will run it next.

> Bruce

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010402103629.jhb>