From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH] replace rdtsc emulation-vs-native xen boot option with per-domain (hypervisor part) Date: Mon, 05 Oct 2009 16:15:18 -0700 Message-ID: <4ACA7E06.80902@goop.org> References: <8831fe4f-9002-40b7-8bef-065c505f6b67@default> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <8831fe4f-9002-40b7-8bef-065c505f6b67@default> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dan Magenheimer Cc: "Xen-Devel (E-mail)" , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 09/27/09 12:22, Dan Magenheimer wrote: > Switches rdtsc emulation from boot option to per-domain > and enables it by default. Also removes hvm tsc scaling > as it is no longer necessary. > > I've run into a few problems from this patch: 1. I'm seeing occasional messages on the console "hrtimer: interrupt too slow, forcing clock min delta to 9001953 ns" which indicates that the kernel is noticing that timer operations are taking too long. 2. A domain can't turn on and off its own tsc emulation state. I'm working on vsyscall support for pvclock (done, aside from this issue), so I need native tsc in usermode (or at least, one with the same parameters in kernel and userspace). I was getting very confused because I didn't expect emulation to *only* apply to usermode; I was expecting it to be done uniformly to both user and kernel tscs, with appropriate adjustments to the vcpu_time_info values. 3. The 's' debug key never seems to count any usermode rdtsc instructions, even if I write a little program to explicitly exercise them. (Fix below) All in 64-bit PV domains. Thanks, J diff -r 1dc86d83b352 xen/arch/x86/time.c --- a/xen/arch/x86/time.c Fri Oct 02 17:01:26 2009 -0700 +++ b/xen/arch/x86/time.c Mon Oct 05 16:13:15 2009 -0700 @@ -1476,7 +1476,7 @@ } else { - v->domain->arch.vtsc_kerncount++; + v->domain->arch.vtsc_usercount++; spin_lock(&v->domain->arch.vtsc_lock); now = get_s_time() + v->domain->arch.vtsc_stime_offset; if ( (int64_t)(now - v->domain->arch.vtsc_last) > 0 )