From owner-freebsd-current Mon Jul 16 3:38: 2 2001 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 3BE6C37B403; Mon, 16 Jul 2001 03:37:59 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA29412; Mon, 16 Jul 2001 20:37:28 +1000 Date: Mon, 16 Jul 2001 20:35:13 +1000 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Tor.Egge@fast.no Cc: juriy@aviaport.ru, freebsd-current@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: kernel with SSE is unstable In-Reply-To: <200107151627.SAA01763@midten.fast.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 15 Jul 2001 Tor.Egge@fast.no wrote: > > In my system kernel(WITH SSE) falls when I use commands netstat and swapinfo. > > kernel without SSE works fine. > > I got a very similar panic when trying an UP kernel with SSE enabled. > > mi_switch() sets curproc->p_oncpu to NOCPU before calling > cpu_switch(). cpu_switch() might call npxsave() which calls fpusave > with NOCPU as the 'oncpu' argument. > > A suggested patch is enclosed. > Index: sys/i386/isa/npx.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v > retrieving revision 1.104 > diff -u -r1.104 npx.c > --- sys/i386/isa/npx.c 2001/07/12 12:21:53 1.104 > +++ sys/i386/isa/npx.c 2001/07/15 16:23:02 > @@ -160,8 +160,8 @@ > #endif > static int npx_probe __P((device_t dev)); > static int npx_probe1 __P((device_t dev)); > -static void fpusave __P((union savefpu *, u_char)); > -static void fpurstor __P((union savefpu *, u_char)); > +static void fpusave __P((union savefpu *)); > +static void fpurstor __P((union savefpu *)); Good. I want all use of the cpu number removed. It seems to be just to avoid alignment problems that shouldn't happen in practice (the save area should always be suitably aligned if it isn't already, and I think it is already). > static void > -fpusave(addr, oncpu) > +fpusave(addr) > union savefpu *addr; > - u_char oncpu; > { > static struct savexmm svxmm[MAXCPU]; > + u_char oncpu = PCPU_GET(cpuid); > > if (!cpu_fxsr) > fnsave(addr); Also, `struct savexmm' is not too large to put on the stack. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message