From owner-svn-src-stable-7@FreeBSD.ORG Wed Oct 29 21:08:35 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3F7106564A; Wed, 29 Oct 2008 21:08:35 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED008FC24; Wed, 29 Oct 2008 21:08:35 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9TL8YV2033087; Wed, 29 Oct 2008 21:08:34 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9TL8YNR033085; Wed, 29 Oct 2008 21:08:34 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200810292108.m9TL8YNR033085@svn.freebsd.org> From: Maxim Sobolev Date: Wed, 29 Oct 2008 21:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184454 - in stable/7/sys: . amd64/amd64 i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2008 21:08:35 -0000 Author: sobomax Date: Wed Oct 29 21:08:34 2008 New Revision: 184454 URL: http://svn.freebsd.org/changeset/base/184454 Log: MFC: don't panic when HZ value is below 32. This change may need a bit of refinement later, as bde says that 4BSD expects stathz of 128, while in this case stathz would be in the range 40-128. Approved by: re (kib, kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/local_apic.c stable/7/sys/i386/i386/local_apic.c Modified: stable/7/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/7/sys/amd64/amd64/local_apic.c Wed Oct 29 20:19:54 2008 (r184453) +++ stable/7/sys/amd64/amd64/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) @@ -401,7 +401,10 @@ lapic_setup_clock(void) lapic_timer_hz = hz * 2; else lapic_timer_hz = hz * 4; - stathz = lapic_timer_hz / (lapic_timer_hz / 128); + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz; Modified: stable/7/sys/i386/i386/local_apic.c ============================================================================== --- stable/7/sys/i386/i386/local_apic.c Wed Oct 29 20:19:54 2008 (r184453) +++ stable/7/sys/i386/i386/local_apic.c Wed Oct 29 21:08:34 2008 (r184454) @@ -403,7 +403,10 @@ lapic_setup_clock(void) lapic_timer_hz = hz * 2; else lapic_timer_hz = hz * 4; - stathz = lapic_timer_hz / (lapic_timer_hz / 128); + if (lapic_timer_hz < 128) + stathz = lapic_timer_hz; + else + stathz = lapic_timer_hz / (lapic_timer_hz / 128); profhz = lapic_timer_hz; lapic_timer_period = value / lapic_timer_hz;