From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 15 03:30:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEB3616A417 for ; Tue, 15 Jan 2008 03:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D291313C467 for ; Tue, 15 Jan 2008 03:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m0F3U2dq037110 for ; Tue, 15 Jan 2008 03:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m0F3U2bA037107; Tue, 15 Jan 2008 03:30:02 GMT (envelope-from gnats) Resent-Date: Tue, 15 Jan 2008 03:30:02 GMT Resent-Message-Id: <200801150330.m0F3U2bA037107@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Leo Bicknell Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0D6816A417 for ; Tue, 15 Jan 2008 03:20:39 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A2D8013C457 for ; Tue, 15 Jan 2008 03:20:39 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0F3JN2i049575 for ; Tue, 15 Jan 2008 03:19:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m0F3JNxf049573; Tue, 15 Jan 2008 03:19:23 GMT (envelope-from nobody) Message-Id: <200801150319.m0F3JNxf049573@www.freebsd.org> Date: Tue, 15 Jan 2008 03:19:23 GMT From: Leo Bicknell To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/119675: apic_hpet0 probe causes divide by zero kernel panic X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jan 2008 03:30:03 -0000 >Number: 119675 >Category: kern >Synopsis: apic_hpet0 probe causes divide by zero kernel panic >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 15 03:30:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Leo Bicknell >Release: 7.0-RC1 >Organization: >Environment: Reproduce with 7.0-RC1 i386 or amd64 install disks. >Description: When probing apic_hpet0 the kernel divides by zero and panics, preventing boot. Disabling ACPI disables the probe, and hence is a work around, but also means other features (e.g. the second core) are disabled. I noticed this was documented in http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2007-05/msg00704.html (regarding a 6.x version) and not solved. The code of interest is in /usr/src/sys/dev/apica/acpi_hpet.c: /* Read basic statistics about the timer. */ val = bus_read_4(sc->mem_res, HPET_OFFSET_PERIOD); freq = (1000000000000000LL + val / 2) / val; if (bootverbose) { val = bus_read_4(sc->mem_res, HPET_OFFSET_INFO); device_printf(dev, "vend: 0x%x rev: 0x%x num: %d hz: %jd opts:%s%s\n", val >> 16, val & 0xff, (val >> 18) & 0xf, freq, ((val >> 15) & 1) ? " leg_route" : "", ((val >> 13) & 1) ? " count_size" : ""); } On this particular machine (Gigabyte GA-54SLI-S4 Motherboard w/Athlon 64 x2 4200) val = 0, so the second line causes a divide by zero error. On this machine in the motherboard BIOS I can set the "high precision timer" to enabled or disabled, 32 bit or 64 bit mode. I have tried all 4 combinations, all produce the same result. I can use the hardware causing this problem as a test case for at least a week or two, if someone can get back to me relatively quickly I can attempt to perform more tests for you and/or get other info fairly promptly. >How-To-Repeat: It appears to me from looking at the CVS diff that booting any i386 or amd64 image on this hardware will cause the problem. Based on google searching it appears while not common, this does affect more than one chipset and motherboard. >Fix: Obviously commenting out the division and hand setting the freq value "fixes" the problem in that the machine will boot, but I suspect this leaves a completely broken hpet0 device. Disabling ACPI disables the probe, allowing boot, but means none of the other APCI goodness is available. >Release-Note: >Audit-Trail: >Unformatted: