From owner-svn-src-head@FreeBSD.ORG Tue Aug 7 23:16:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A66891065670; Tue, 7 Aug 2012 23:16:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 915F38FC12; Tue, 7 Aug 2012 23:16:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q77NGCQn016538; Tue, 7 Aug 2012 23:16:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q77NGC2s016536; Tue, 7 Aug 2012 23:16:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201208072316.q77NGC2s016536@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Aug 2012 23:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239133 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Aug 2012 23:16:12 -0000 Author: jimharris Date: Tue Aug 7 23:16:11 2012 New Revision: 239133 URL: http://svn.freebsd.org/changeset/base/239133 Log: During TSC synchronization test, use rdtsc() rather than rdtsc32(), to protect against 32-bit TSC overflow while the sync test is running. On dual-socket Xeon E5-2600 (SNB) systems with up to 32 threads, there is non-trivial chance (2-3%) that TSC synchronization test fails due to 32-bit TSC overflow while the synchronization test is running. Sponsored by: Intel Reviewed by: jkim Discussed with: jkim, kib Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Aug 7 20:16:10 2012 (r239132) +++ head/sys/x86/x86/tsc.c Tue Aug 7 23:16:11 2012 (r239133) @@ -363,11 +363,11 @@ init_TSC(void) static void \ tsc_read_##x(void *arg) \ { \ - uint32_t *tsc = arg; \ + uint64_t *tsc = arg; \ u_int cpu = PCPU_GET(cpuid); \ \ __asm __volatile("cpuid" : : : "eax", "ebx", "ecx", "edx"); \ - tsc[cpu * 3 + x] = rdtsc32(); \ + tsc[cpu * 3 + x] = rdtsc(); \ } TSC_READ(0) TSC_READ(1) @@ -379,8 +379,8 @@ TSC_READ(2) static void comp_smp_tsc(void *arg) { - uint32_t *tsc; - int32_t d1, d2; + uint64_t *tsc; + int64_t d1, d2; u_int cpu = PCPU_GET(cpuid); u_int i, j, size; @@ -401,7 +401,7 @@ comp_smp_tsc(void *arg) static int test_smp_tsc(void) { - uint32_t *data, *tsc; + uint64_t *data, *tsc; u_int i, size; if (!smp_tsc && !tsc_is_invariant)