From owner-freebsd-current Tue Jul 17 2:52:43 2001 Delivered-To: freebsd-current@freebsd.org Received: from midten.fast.no (midten.fast.no [213.188.8.11]) by hub.freebsd.org (Postfix) with ESMTP id 6BCDD37B406; Tue, 17 Jul 2001 02:52:38 -0700 (PDT) (envelope-from Tor.Egge@fast.no) Received: from fast.no (IDENT:tegge@midten.fast.no [213.188.8.11]) by midten.fast.no (8.9.3/8.9.3) with ESMTP id LAA72393; Tue, 17 Jul 2001 11:51:58 +0200 (CEST) Message-Id: <200107170951.LAA72393@midten.fast.no> To: bde@zeta.org.au Cc: juriy@aviaport.ru, freebsd-current@FreeBSD.ORG, peter@FreeBSD.ORG Subject: Re: kernel with SSE is unstable From: Tor.Egge@fast.no In-Reply-To: Your message of "Mon, 16 Jul 2001 20:35:13 +1000 (EST)" References: X-Mailer: Mew version 1.70 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Jul_17_11:46:48_2001)--" Content-Transfer-Encoding: 7bit Date: Tue, 17 Jul 2001 11:51:57 +0200 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 ----Next_Part(Tue_Jul_17_11:46:48_2001)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > 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). The pcb_save area has the proper alignment but the dummy variable used in npxinit might not have the proper alignment when on the stack. The enclosed patch should be a step in the right direction. - Tor Egge ----Next_Part(Tue_Jul_17_11:46:48_2001)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Index: sys/i386/isa/npx.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v retrieving revision 1.105 diff -u -r1.105 npx.c --- sys/i386/isa/npx.c 2001/07/16 06:00:23 1.105 +++ sys/i386/isa/npx.c 2001/07/16 16:54:13 @@ -564,7 +564,7 @@ npxinit(control) u_short control; { - union savefpu dummy; + static union savefpu dummy; critical_t savecrit; if (!npx_exists) @@ -926,30 +926,21 @@ fpusave(addr) union savefpu *addr; { - static struct savexmm svxmm[MAXCPU]; - u_char oncpu = PCPU_GET(cpuid); if (!cpu_fxsr) fnsave(addr); - else { - fxsave(&svxmm[oncpu]); - bcopy(&svxmm[oncpu], addr, sizeof(struct savexmm)); - } + else + fxsave(addr); } static void fpurstor(addr) union savefpu *addr; { - static struct savexmm svxmm[MAXCPU]; - u_char oncpu = PCPU_GET(cpuid); - if (!cpu_fxsr) frstor(addr); - else { - bcopy(addr, &svxmm[oncpu], sizeof (struct savexmm)); - fxrstor(&svxmm[oncpu]); - } + else + fxrstor(addr); } #ifdef I586_CPU_XXX ----Next_Part(Tue_Jul_17_11:46:48_2001)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message