From owner-freebsd-current@FreeBSD.ORG Sun Nov 4 21:26:22 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B95BF16A420 for ; Sun, 4 Nov 2007 21:26:22 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by mx1.freebsd.org (Postfix) with ESMTP id 4F97E13C494 for ; Sun, 4 Nov 2007 21:26:20 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by ug-out-1314.google.com with SMTP id y2so975816uge for ; Sun, 04 Nov 2007 13:26: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:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer:sender; bh=kM6iUTDUZ29ECWpboDyOzuqgmoAsG2POY3iWwLhgGXw=; b=cXCOGnogeh547p2Be22oIIgmWsEQ49HLTU7lkWglc2KMeP7xK5gphKBA3HfAs8LHLUp/jAv6MUPRn3yeOg/m/3IqW8T96dABl9ZpzVMJGUEp80lEBDHB6L36/+nuqwGpmiYacPUqkR8pQoLPC/ZRp+HAg7IjTgwl1NGKsoyfKXc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer:sender; b=r2/Uq4AUZh25cXIR+IyY3vPjniz4cshZlWgQwQEblzWZntoMf/wg1MdaJlvmQYImUBLgSkZWSDSz0tVlH4kCSi2mf44n1x3FpELgbr6fWkjEbxzmjs7VXm91cXz47g6rO18W49rlbMdEMpUJgdnLDjexYeQ0ZtIAlh//hBnLsIo= Received: by 10.67.24.11 with SMTP id b11mr647325ugj.1194209975674; Sun, 04 Nov 2007 12:59:35 -0800 (PST) Received: from epsilon.mshome.net ( [78.130.8.20]) by mx.google.com with ESMTPS id d26sm9969058nfh.2007.11.04.12.59.32 (version=SSLv3 cipher=OTHER); Sun, 04 Nov 2007 12:59:34 -0800 (PST) Message-Id: <4A5A9C78-22AC-4480-BDEB-A72F6CF472DB@fnop.net> From: Rui Paulo To: freebsd-hardware@FreeBSD.org, freebsd-current@FreeBSD.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v912) Date: Sun, 4 Nov 2007 20:59:28 +0000 X-Mailer: Apple Mail (2.912) Sender: Rui Paulo X-Mailman-Approved-At: Sun, 04 Nov 2007 21:48:54 +0000 Cc: Subject: MacBook users: possible fix for the SMP problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 04 Nov 2007 21:26:22 -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