From owner-freebsd-amd64@FreeBSD.ORG Mon Jul 23 01:07:39 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C0391065670; Mon, 23 Jul 2012 01:07:39 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB878FC16; Mon, 23 Jul 2012 01:07:39 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6N17dUY097875; Mon, 23 Jul 2012 01:07:39 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6N17d9P097871; Mon, 23 Jul 2012 01:07:39 GMT (envelope-from linimon) Date: Mon, 23 Jul 2012 01:07:39 GMT Message-Id: <201207230107.q6N17d9P097871@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-amd64@FreeBSD.org, freebsd-fs@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/169945: [zfs] [panic] Kernel panic while importing zpool (after having a kernel panic) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 01:07:39 -0000 Old Synopsis: Kernel panic while importing zpool (after having a kernel panic) New Synopsis: [zfs] [panic] Kernel panic while importing zpool (after having a kernel panic) Responsible-Changed-From-To: freebsd-amd64->freebsd-fs Responsible-Changed-By: linimon Responsible-Changed-When: Mon Jul 23 01:07:23 UTC 2012 Responsible-Changed-Why: reclassify. http://www.freebsd.org/cgi/query-pr.cgi?pr=169945 From owner-freebsd-amd64@FreeBSD.ORG Mon Jul 23 11:07:08 2012 Return-Path: Delivered-To: freebsd-amd64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E16B91065672 for ; Mon, 23 Jul 2012 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id CA7938FC18 for ; Mon, 23 Jul 2012 11:07:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6NB787a089936 for ; Mon, 23 Jul 2012 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6NB78pm089934 for freebsd-amd64@FreeBSD.org; Mon, 23 Jul 2012 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Jul 2012 11:07:08 GMT Message-Id: <201207231107.q6NB78pm089934@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-amd64@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-amd64@FreeBSD.org X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 11:07:09 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o amd64/168659 amd64 [boot] FreeBSD 9 - Crash upon booting off install CD ( o amd64/167582 amd64 Compile of MySQL NDB Cluster Fails 8.2 AMD64 o amd64/167543 amd64 [kernel] Install FreeBSD can show error message with c o amd64/167393 amd64 [boot] MacBook4,1 hangs on SMP boot o amd64/166639 amd64 [boot] Syscons issue Intel D2700 o amd64/166229 amd64 [boot] Unable to install FreeBSD 9 on Acer Extensa 522 o amd64/165850 amd64 [build] 8.3-RC1 (amd64): world doesn't build with CPUT o amd64/165845 amd64 [build] Unable to build kernel on 8.2-STABLE o amd64/165351 amd64 [boot] Error while installing or booting the freeBSD O o amd64/164773 amd64 [boot] 9.0 amd64 fails to boot on HP DL145 G3 [regress o amd64/164707 amd64 FreeBSD 9 installer does not work with IBM uefi o amd64/164643 amd64 Kernel Panic at 9.0-RELEASE o amd64/164619 amd64 when logged in as root the user and group applications o amd64/164457 amd64 [install] Can't install FreeBSD 9.0 (amd64) on HP Blad o amd64/164301 amd64 [install] 9.0 - Can't install, no DHCP lease o amd64/164136 amd64 after fresh install 8.1 release or 8.2 release the har o amd64/164116 amd64 [boot] FreeBSD 9.0-RELEASE installations mediums fails o amd64/164089 amd64 FreeBSD-9.0-RELEASE-amd64-memstick.img does not boot o amd64/164073 amd64 /etc/rc warning after booting o amd64/164036 amd64 [keyboard] Moused fails on 9_0_RELENG o amd64/163736 amd64 Freebsd 8.2 with MPD5 and about 100 PPPoE clients pani o amd64/163710 amd64 setjump in userboot.so causes stack corruption o amd64/163625 amd64 Install problems of RC3 amd64 on ASRock N68 GE3 UCC o amd64/163568 amd64 hard drive naming o amd64/163285 amd64 when installing gnome2-lite not all dependent packages o amd64/163284 amd64 print manager failed to install correctly o amd64/163114 amd64 no boot on Via Nanao netbook Samsung NC20 o amd64/163092 amd64 FreeBSD 9.0-RC2 fails to boot from raid-z2 if AHCI is o amd64/163048 amd64 normal user cant mount ntfs-3g o amd64/162936 amd64 fails boot and destabilizes other OSes on FreeBSD 9 RC o amd64/162489 amd64 After some time X blanks the screen and does not respo o amd64/162314 amd64 not able to install FreeBSD-8.2-RELEASE-amd64-dvd1 as o amd64/162219 amd64 [REGRESSION] In KDE 4.7.2 cant enable OpenGL,in 4.6.5 o amd64/162170 amd64 Unable to install due to freeze at "run_interrupt_driv o amd64/161974 amd64 FreeBSD 9 new installer installs succesful, renders ma o kern/160833 amd64 Keyboard USB doesn't work o amd64/157386 amd64 [powerd] Enabling powerd(8) with default settings on I o amd64/156106 amd64 [boot] boot0 fails to start o amd64/155135 amd64 [boot] Does Not Boot On a Very Standard Hardware o amd64/154957 amd64 [boot] Install boot CD won't boot up - keeps rebooting o amd64/154629 amd64 [panic] Fatal trap 9: general protection fault while i o amd64/153935 amd64 [hang] system hangs while trying to do 'shutdown -h no o amd64/153831 amd64 [boot] CD bootloader won't on Tyan s2912G2nr o amd64/153496 amd64 [hyper-v] [install] Install on Hyper-V leaves corrupt o amd64/153372 amd64 [panic] kernel panic o amd64/153175 amd64 [amd64] Kernel Panic on only FreeBSD 8 amd64 o amd64/152874 amd64 [install] 8.1 install fails where 7.3 works due to lac o amd64/152430 amd64 [boot] HP ProLiant Microserver n36l cannot boot into i o amd64/145991 amd64 [NOTES] [patch] Add a requires line to /sys/amd64/conf o amd64/144405 amd64 [build] [patch] include /usr/obj/lib32 in cleanworld t s amd64/143173 amd64 [ata] Promise FastTrack TX4 + SATA DVD, installer can' p amd64/141413 amd64 [hang] Tyan 2881 m3289 SMDC freeze o amd64/137942 amd64 [pci] 8.0-BETA2 having problems with Asus M2N-SLI-delu o amd64/127640 amd64 [amd64] gcc(1) will not build shared libraries with -f o amd64/115194 amd64 LCD screen remains blank after Dell XPS M1210 lid is c 55 problems total. From owner-freebsd-amd64@FreeBSD.ORG Tue Jul 24 18:20:11 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3657B1065672 for ; Tue, 24 Jul 2012 18:20:10 +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 C1E638FC22 for ; Tue, 24 Jul 2012 18:20:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6OIKAc8057814 for ; Tue, 24 Jul 2012 18:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6OIKA6r057813; Tue, 24 Jul 2012 18:20:10 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jul 2012 18:20:10 GMT Resent-Message-Id: <201207241820.q6OIKA6r057813@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Paul Macdonald Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C19BE1065676 for ; Tue, 24 Jul 2012 18:12:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9497E8FC12 for ; Tue, 24 Jul 2012 18:12:58 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6OICwwF074781 for ; Tue, 24 Jul 2012 18:12:58 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6OICwBt074780; Tue, 24 Jul 2012 18:12:58 GMT (envelope-from nobody) Message-Id: <201207241812.q6OICwBt074780@red.freebsd.org> Date: Tue, 24 Jul 2012 18:12:58 GMT From: Paul Macdonald To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Tue, 24 Jul 2012 18:46:14 +0000 Cc: Subject: amd64/170115: Serial boot broken in 9.0 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 18:20:11 -0000 >Number: 170115 >Category: amd64 >Synopsis: Serial boot broken in 9.0 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 24 18:20:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Paul Macdonald >Release: 9.0 >Organization: IFDNRG >Environment: any ( install problem) >Description: Serial loader seems broken under 9.0 Using FreeBSD-8,3-RELEASE-amd64-bootonly.iso adding to boot/loader.conf bootconsole="comconsole" comconsole_speed="57600" Sufficient for serial install to work fine Under 9.0 (All install isos) stage 3 loader never appears >How-To-Repeat: serial install under 9.0 (any iso) with loader.conf of: bootconsole="comconsole" comconsole_speed="57600" >Fix: >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-amd64@FreeBSD.ORG Fri Jul 27 10:20:06 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF16A1065672 for ; Fri, 27 Jul 2012 10:20:06 +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 9EA7C8FC18 for ; Fri, 27 Jul 2012 10:20:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6RAK676025550 for ; Fri, 27 Jul 2012 10:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6RAK69g025549; Fri, 27 Jul 2012 10:20:06 GMT (envelope-from gnats) Resent-Date: Fri, 27 Jul 2012 10:20:06 GMT Resent-Message-Id: <201207271020.q6RAK69g025549@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Giacomo Strangolino Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BEEC1065670 for ; Fri, 27 Jul 2012 10:15:24 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 16E3F8FC12 for ; Fri, 27 Jul 2012 10:15:24 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6RAFNJd013664 for ; Fri, 27 Jul 2012 10:15:23 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6RAFNsM013656; Fri, 27 Jul 2012 10:15:23 GMT (envelope-from nobody) Message-Id: <201207271015.q6RAFNsM013656@red.freebsd.org> Date: Fri, 27 Jul 2012 10:15:23 GMT From: Giacomo Strangolino To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Fri, 27 Jul 2012 11:15:34 +0000 Cc: Subject: amd64/170209: kdepim4 fails to link with libinotify (and also kdepim44) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:20:07 -0000 >Number: 170209 >Category: amd64 >Synopsis: kdepim4 fails to link with libinotify (and also kdepim44) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 27 10:20:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Giacomo Strangolino >Release: 9 >Organization: Elettra Sincrotrone Trieste >Environment: FreeBSD woody 9.0-RELEASE FreeBSD 9.0-RELEASE ... amd64 >Description: deskutils/kdepim4 fails to build giving a link error (undefined reference to inotify_add_watch and inotify_init) same thing for kdepim44 ./lib/libkmailprivate.so.5.0.1: undefined reference to `inotify_add_watch' ./lib/libkmailprivate.so.5.0.1: undefined reference to `inotify_init' >How-To-Repeat: cd /usr/ports/deskutils/kdepim4 make >Fix: edit deskutils/kdepim4/work/kdepim-4.8.4/messageviewer CMakeLists.txt add -linotify in target_link_libraries(.... ) >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-amd64@FreeBSD.ORG Fri Jul 27 15:06:02 2012 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 283A61065672; Fri, 27 Jul 2012 15:06:02 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ED3D18FC15; Fri, 27 Jul 2012 15:06:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6RF61pu063917; Fri, 27 Jul 2012 15:06:01 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6RF610g063913; Fri, 27 Jul 2012 15:06:01 GMT (envelope-from linimon) Date: Fri, 27 Jul 2012 15:06:01 GMT Message-Id: <201207271506.q6RF610g063913@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-amd64@FreeBSD.org, kde@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: ports/170209: deskutils/kdepim4 fails to link with libinotify (and also kdepim44) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 15:06:02 -0000 Old Synopsis: kdepim4 fails to link with libinotify (and also kdepim44) New Synopsis: deskutils/kdepim4 fails to link with libinotify (and also kdepim44) Responsible-Changed-From-To: freebsd-amd64->kde Responsible-Changed-By: linimon Responsible-Changed-When: Fri Jul 27 15:04:57 UTC 2012 Responsible-Changed-Why: Make this a ports PR, fix Synopsis, and assign. http://www.freebsd.org/cgi/query-pr.cgi?pr=170209 From owner-freebsd-amd64@FreeBSD.ORG Sat Jul 28 16:02:08 2012 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9794106566B; Sat, 28 Jul 2012 16:02:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 327738FC08; Sat, 28 Jul 2012 16:02:07 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6SG2Ggj029391; Sat, 28 Jul 2012 19:02:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6SG23Xa025928; Sat, 28 Jul 2012 19:02:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6SG22nx025927; Sat, 28 Jul 2012 19:02:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Jul 2012 19:02:02 +0300 From: Konstantin Belousov To: amd64@freebsd.org Message-ID: <20120728160202.GI2676@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DZpZF4rn8ymM3zt1" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Jim Harris , Andriy Gapon Subject: Use fences for kernel tsc reads. X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 16:02:08 -0000 --DZpZF4rn8ymM3zt1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, This was discussed on somewhat unwieldly thread on svn-src@ as a followup to the commit r238755 which uncovered the problem in the first place. Below is the commit candidate. It changes the fix in r238755 to use CPUID instead of rmb(), since rmb() translates to locked operation on i386, and experimentation shown that Nehalem's RDTSC can pass LOCK. Also, I explicitely use LFENCE and MFENCE instead using rmb() and mb(), for the same reason that on i386 implementation of *mb() is a locked operation instead of fence. Jim, could you please, recheck that on your machine there is no regression in the TSC synchronization test ? Handling of usermode will follow later. diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 94d4133..881fcd2 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -290,6 +290,13 @@ popcntq(u_long mask) } =20 static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { =20 diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 62d268d..7cd3663 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -155,6 +155,13 @@ cpu_mwait(u_long extensions, u_int hints) } =20 static __inline void +lfence(void) +{ + + __asm __volatile("lfence" : : : "memory"); +} + +static __inline void mfence(void) { =20 diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index c253a96..101cbb3 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -83,6 +83,10 @@ static void tsc_freq_changing(void *arg, const struct cf= _level *level, int *status); static unsigned tsc_get_timecount(struct timecounter *tc); static unsigned tsc_get_timecount_low(struct timecounter *tc); +static unsigned tsc_get_timecount_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_mfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); =20 static struct timecounter tsc_timecounter =3D { @@ -262,6 +266,10 @@ probe_tsc_freq(void) (vm_guest =3D=3D VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >=3D 0x10)) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_mfence; + } break; case CPU_VENDOR_INTEL: if ((amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0 || @@ -271,6 +279,10 @@ probe_tsc_freq(void) (CPUID_TO_FAMILY(cpu_id) =3D=3D 0xf && CPUID_TO_MODEL(cpu_id) >=3D 0x3)))) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_lfence; + } break; case CPU_VENDOR_CENTAUR: if (vm_guest =3D=3D VM_GUEST_NO && @@ -278,6 +290,10 @@ probe_tsc_freq(void) CPUID_TO_MODEL(cpu_id) >=3D 0xf && (rdmsr(0x1203) & 0x100000000ULL) =3D=3D 0) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_lfence; + } break; } =20 @@ -328,15 +344,26 @@ init_TSC(void) =20 #ifdef SMP =20 -/* rmb is required here because rdtsc is not a serializing instruction. */ +/* + * RDTSC is not a serializing instruction, so we need to drain + * instruction stream before executing it. It could be fixed by use of + * RDTSCP, except the instruction is not available everywhere. + * + * Use CPUID for draining. The timecounters use MFENCE for AMD CPUs, + * and LFENCE for others (Intel and VIA) when SSE2 is present, and + * nothing on older machines which also do not issue RDTSC + * prematurely. There, testing for SSE2 and vendor is too cumbersome, + * and we learn about TSC presence from CPUID. + */ #define TSC_READ(x) \ static void \ tsc_read_##x(void *arg) \ { \ uint32_t *tsc =3D arg; \ + u_int p[4]; \ u_int cpu =3D PCPU_GET(cpuid); \ \ - rmb(); \ + do_cpuid(0, p); \ tsc[cpu * 3 + x] =3D rdtsc32(); \ } TSC_READ(0) @@ -487,7 +514,16 @@ init: for (shift =3D 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { - tsc_timecounter.tc_get_timecount =3D tsc_get_timecount_low; + if (cpu_feature & CPUID_SSE2) { + if (cpu_vendor_id =3D=3D CPU_VENDOR_AMD) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_low_mfence; + } else { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_low_lfence; + } + } else + tsc_timecounter.tc_get_timecount =3D tsc_get_timecount_low; tsc_timecounter.tc_name =3D "TSC-low"; if (bootverbose) printf("TSC timecounter discards lower %d bit(s)\n", @@ -592,23 +628,55 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW, 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency"); =20 -static u_int +static inline u_int tsc_get_timecount(struct timecounter *tc __unused) { =20 return (rdtsc32()); } =20 -static u_int +static inline u_int tsc_get_timecount_low(struct timecounter *tc) { uint32_t rv; =20 __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } =20 +static inline u_int +tsc_get_timecount_lfence(struct timecounter *tc __unused) +{ + + lfence(); + return (rdtsc32()); +} + +static inline u_int +tsc_get_timecount_low_lfence(struct timecounter *tc) +{ + + lfence(); + return (tsc_get_timecount_low(tc)); +} + +static inline u_int +tsc_get_timecount_mfence(struct timecounter *tc __unused) +{ + + mfence(); + return (rdtsc32()); +} + +static inline u_int +tsc_get_timecount_low_mfence(struct timecounter *tc) +{ + + mfence(); + return (tsc_get_timecount_low(tc)); +} + uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) { --DZpZF4rn8ymM3zt1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAUDPoACgkQC3+MBN1Mb4jzWQCeKjji4pIz/aFAvR2ZA4BPeYoR 0UsAmQHcbosSlJQ3DlgOfA9HFblw1Wsg =Vlmf -----END PGP SIGNATURE----- --DZpZF4rn8ymM3zt1-- From owner-freebsd-amd64@FreeBSD.ORG Sat Jul 28 17:12:32 2012 Return-Path: Delivered-To: amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7590D106564A; Sat, 28 Jul 2012 17:12:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E1EA58FC08; Sat, 28 Jul 2012 17:12:31 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6SHCT4j033902; Sat, 28 Jul 2012 20:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6SHCGST026249; Sat, 28 Jul 2012 20:12:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6SHCGu3026248; Sat, 28 Jul 2012 20:12:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Jul 2012 20:12:16 +0300 From: Konstantin Belousov To: Jim Harris Message-ID: <20120728171216.GK2676@deviant.kiev.zoral.com.ua> References: <20120728160202.GI2676@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="USf1PyUzamLyyBMw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "amd64@freebsd.org" , Andriy Gapon Subject: Re: Use fences for kernel tsc reads. X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 17:12:32 -0000 --USf1PyUzamLyyBMw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 28, 2012 at 09:36:43AM -0700, Jim Harris wrote: > On Saturday, July 28, 2012, Konstantin Belousov wrote: >=20 > > Hi, > > > > This was discussed on somewhat unwieldly thread on svn-src@ as a follow= up > > to the commit r238755 which uncovered the problem in the first place. > > > > Below is the commit candidate. It changes the fix in r238755 to use CPU= ID > > instead of rmb(), since rmb() translates to locked operation on i386, > > and experimentation shown that Nehalem's RDTSC can pass LOCK. > > > > Also, I explicitely use LFENCE and MFENCE instead using rmb() and mb(), > > for the same reason that on i386 implementation of *mb() is a locked > > operation instead of fence. > > > > Jim, could you please, recheck that on your machine there is no regress= ion > > in the TSC synchronization test ? > > > Ok. I will do this first thing on Monday. Should I still MFC my patch to > stable-9? Definitely, please merge. I do not think that SMP && !SSE2 is important population for us, and since SMP machines of that kind were definitely multi-socket, I doubt that TSC was synchronized for them anyway. Users will need to disable tsc manually. --USf1PyUzamLyyBMw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAUHXAACgkQC3+MBN1Mb4gh2ACdHZRNWFg6/mRRoCma1QbbXERb E94AoOabrODg9s2idvR24ALDlZCWOxyV =JUhS -----END PGP SIGNATURE----- --USf1PyUzamLyyBMw--