From owner-freebsd-i386@FreeBSD.ORG Mon Nov 5 00:17:26 2007 Return-Path: Delivered-To: freebsd-i386@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1680E16A417 for ; Mon, 5 Nov 2007 00:17:26 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.179]) by mx1.freebsd.org (Postfix) with ESMTP id CC5E413C49D for ; Mon, 5 Nov 2007 00:17:25 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so2840765pyb for ; Sun, 04 Nov 2007 16:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=hW+UidP08b/AKArdjwwggOf9s1PVycST5+HaAABZuG4=; b=Ma4bkGhzJoko3Pe7X6AO5qocgc4muMq1pNO5YzlXeD0TPZae4l+VaeQxYzG/ABL5ld1QKh9K4hAUMnEoGPf97/UAR9kwcatL3teHLcQ39OIFgbOr5Jg3N/K+LqR3vfs6GvuNyDD0WZPdrbdK0EK/PefaGttokn0eDL6E4sANmLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=pM6D3xuD60E6zSml1sAAogo3wLghCkisOjg/ZImWXq329+qihVSoVPKEgH1Uf2843EFub9rrP7tXON5Tu98EJGDTLaGX05V0X5BOnGBk3JQQpATIcocuP+4ZkEEcvqexZihapGcyvIOJhGOolHefoKR6f+Y6G0RDFLg4HBFNOis= Received: by 10.35.82.16 with SMTP id j16mr5322901pyl.1194220388444; Sun, 04 Nov 2007 15:53:08 -0800 (PST) Received: by 10.35.9.16 with HTTP; Sun, 4 Nov 2007 15:53:08 -0800 (PST) Message-ID: Date: Sun, 4 Nov 2007 23:53:08 +0000 From: "Rui Paulo" Sender: rpaulo@gmail.com To: freebsd-current@freebsd.org, freebsd-i386@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: b1906798fa1f8122 Cc: Subject: MacBook users: possible fix for the SMP problem X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Nov 2007 00:17:26 -0000 Hi, I've been contacted by Marco Trillo and I think he has found the source of the SMP problem. The problem seems to rely on Intel ICH7. Basically we need to disable the "LEGACY_USB" bit before we calibrate the clocks. "LEGACY_USB", according to Marco (I don't have the ICH7 spec at hand), "causes legacy USB circuit to generate SMIs". Please try the following patch: --- sys/amd64/isa/clock.c.orig 2007-11-04 20:31:09.000000000 +0000 +++ sys/amd64/isa/clock.c 2007-11-04 20:34:59.000000000 +0000 @@ -577,6 +577,8 @@ startrtclock() writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, RTCSB_24HR); + outl(0x430, inl(0x430) & ~0x8); + freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) { --- sys/i386/isa/clock.c.orig 2007-11-04 20:34:03.000000000 +0000 +++ sys/i386/isa/clock.c 2007-11-04 20:34:30.000000000 +0000 @@ -621,6 +621,8 @@ startrtclock() writertc(RTC_STATUSA, rtc_statusa); writertc(RTC_STATUSB, RTCSB_24HR); + outl(0x430, inl(0x430) & ~0x8); + freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) { This should probably fix two issues: 1) The second core should start without any trick (e.g. key press) 2) We should be able to run with HZ=1000 (the default) without any problem. To check if this is indeed the case, try booting with HZ=1000 (loader.conf variable kern.hz) and check if your CPU clock shows up correctly in the dmesg. After that, please also check if 'time sleep 1' takes one second (not more and not less). Also, please test if there are any USB problems. Note: this is still a hack. I'm still thinking about a way to correctly identify on which systems we need to apply this fix. Regards. -- Rui Paulo