From owner-freebsd-emulation@FreeBSD.ORG Wed Nov 28 16:16:17 2012 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7EA3980; Wed, 28 Nov 2012 16:16:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 77C858FC15; Wed, 28 Nov 2012 16:16:16 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA28276; Wed, 28 Nov 2012 18:16:14 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <50B638CD.4020208@FreeBSD.org> Date: Wed, 28 Nov 2012 18:16:13 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alex Chistyakov Subject: Re: VirtualBox 4.2.4 on FreeBSD 9.1-PRERELEASE problem: VMs behave very different when pinned to different cores References: <50AFAD05.1050604@FreeBSD.org> <50B25C17.20208@FreeBSD.org> <50B62CB3.70101@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: "freebsd-emulation@freebsd.org" , Alexander Motin X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 16:16:18 -0000 on 28/11/2012 17:34 Alex Chistyakov said the following: > On Wed, Nov 28, 2012 at 7:24 PM, Andriy Gapon wrote: >> on 26/11/2012 09:10 Alex Chistyakov said the following: >>> CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz (3200.18-MHz K8-class CPU) >>> Origin = "GenuineIntel" Id = 0x206d7 Family = 0x6 Model = 0x2d >>> Stepping = 7 >>> Features=0xbfebfbff >>> Features2=0x1fbee3bf >>> AMD Features=0x2c100800 >>> AMD Features2=0x1 >>> TSC: P-state invariant, performance statistics >>> >> >> Is this a multi-socket system? > > No, this is a single-socket desktop grade baseboard, Intel DX79TO. > I'd say that there must be some kind of hardware or firmware (BIOS) problem to create such a discrepancy in TSC readings. >> It would be very strange that a modern CPU like this would have such a skew >> between TSC on different cores. >> >> On my Core i5-3570 I see that the _observed_ skew is no more than 100 ticks (after >> many days of uptime). It could be zero, in fact, given the inaccuracy of >> inter-core measurements. You could try the following (totally untested) patch as an experiment. Just to see if indeed there is some connection between the TSC issue and the main issue. --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -398,6 +398,13 @@ comp_smp_tsc(void *arg) } } +static void +reset_tsc(void *arg) +{ + + wrmsr(MSR_TSC, (uintptr_t)arg); +} + static int test_smp_tsc(void) { @@ -406,6 +413,9 @@ test_smp_tsc(void) if (!smp_tsc && !tsc_is_invariant) return (-100); + + smp_rendezvous(NULL, reset_tsc, NULL, (void*)0); + size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); for (i = 0, tsc = data; i < N; i++, tsc += size) -- Andriy Gapon