From owner-freebsd-current@FreeBSD.ORG Fri Jul 11 14:37:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD95E37B401; Fri, 11 Jul 2003 14:37:31 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDFF743FBF; Fri, 11 Jul 2003 14:37:29 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id HAA18159; Sat, 12 Jul 2003 07:37:26 +1000 Date: Sat, 12 Jul 2003 07:37:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Don Lewis In-Reply-To: <200307111844.h6BIicM7018465@gw.catspoiler.org> Message-ID: <20030712065656.C31200@gamplex.bde.org> References: <200307111844.h6BIicM7018465@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org cc: l.ertl@univie.ac.at Subject: Re: Kernel built with new GCC panics immediately X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2003 21:37:32 -0000 On Fri, 11 Jul 2003, Don Lewis wrote: > On 11 Jul, Shizuka Kudo wrote: > > > > --- Lukas Ertl wrote: > >> Hi there, > >> > >> just wanted to report that a kernel built with the new gcc panics > >> immediately when booting. I've seen this on two machines. Panic and reboot > >> happens fast that I couldn't get the panic message. > > > > Same here for an AMD Athlon & a Pentium III. The panic message for AMD is: > > [Trailing whitespace removed] > > Copyright (c) 1992-2003 The FreeBSD Project. > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > > The Regents of the University of California. All rights reserved. > > FreeBSD 5.1-CURRENT #20030712: Sat Jul 12 01:35:44 HKT 2003 > > root@shizuka.gundumv.com:/usr/obj/usr/src/sys/SHIZUKA > > Preloaded elf kernel "/boot/kernel/kernel" at 0xc058a000. > > Preloaded elf module "/boot/kernel/acpi.ko" at 0xc058a1f4. > > Timecounter "i8254" frequency 1193182 Hz > > CPU: AMD Unknown (286-class CPU) > ^^^ > That's quite a downgrade ;-) > > This smells like a problem in either printcpuinfo(), lowcore.s, or the > interface between them. > > > Origin = "AuthenticAMD" Stepping = 0 > > panic: CPU class not configured > > Debugger("panic") Try compiling with cc -no-zero-initialized-in-bss. gcc now puts zero-initialized variables in the bss by default, so an old bug in locore.s probably just became fatal. From locore.s: % call identify_cpu This sets some variables (in particular, `cpu') which are now mostly in the bss. % % /* clear bss */ % /* % * XXX this should be done a little earlier. % * % * XXX we don't check that there is memory for our bss and page tables % * before using it. % * % * XXX the boot program somewhat bogusly clears the bss. We still have % * to do it in case we were unzipped by kzipboot. Then the boot program % * only clears kzipboot's bss. % * % * XXX the gdt and idt are still somewhere in the boot program. We % * depend on the convention that the boot program is below 1MB and we % * are above 1MB to keep the gdt and idt away from the bss and page % * tables. % */ % movl $R(end),%ecx % movl $R(edata),%edi % subl %edi,%ecx % xorl %eax,%eax % cld % rep % stosb This clobbers any bss variables set by identify_cpu. Bruce