From: Keir Fraser Subject: Re: rdtscP and xen (and maybe the app-tsc answer I've been looking for) Date: Mon, 21 Sep 2009 19:17:21 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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 , Jan Beulich Cc: JeremyFitzhardinge , "Xen-Devel (E-mail)" , "kurt.hackel@oracle.com" , "Langsdorf, Mark" , "Nakajima, Jun" , Alex Williamson List-Id: xen-devel@lists.xenproject.org On 21/09/2009 18:56, "Dan Magenheimer" wrote: > By constant_tsc I mean that CPUID:0x80000007:EDX:8 > is set. Well, if it is at least true for 99% of systems, then it might be worth enabling constant_tsc support by default, and detect TSC divergence at runtime and disbale dynamically. I think that's what Linux does (i.e., it has a fallback at runtime if its TSC assumptions turn out to be wrong). -- Keir > Upstream Linux (2.6.30) now uses the term > X86_FEATURE_TSC_RELIABLE to indicate that tsc is > consistent across cores and sockets and > X86_FEATURE_NONSTOP_TSC to indicate that it > doesn't stop in deep C-states (which Xen compensates > for) and X86_FEATURE_CONSTANT_TSC to indicate that > it stays running across P/T state transitions. > On Intel systems, CPUID:0x80000007:EDX:8 enables > all of these feature flags. (Interestingly, on > AMD systems, X86_FEATURE_TSC_RELIABLE is *not* > set by this bit... so my information from AMD is > not represented in Linux (yet)). Note also that > in linux-2.6.30/arch/x86/kernel/cpu/vmware.c, both > X86_FEATURE_CONSTANT_TSC and X86_FEATURE_TSC_RELIABLE > get set.