From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Winchell Subject: Re: [PATCH 1/2] Migrate tsc values during migration Date: Fri, 06 Jun 2008 10:49:45 -0400 Message-ID: <48494E89.5070200@virtualiron.com> References: <4847FF6F.4090506@virtualiron.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit 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: "Cui, Dexuan" Cc: xen-devel , Ben Guthro List-Id: xen-devel@lists.xenproject.org Dexuan, Thanks for catching this. How about this (taken from msr.h)? #if defined(__i386__) #define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) #elif defined(__x86_64__) #define rdtscll(val) do { \ unsigned int a,d; \ asm volatile("rdtsc" : "=a" (a), "=d" (d)); \ (val) = ((unsigned long)a) | (((unsigned long)d)<<32); \ } while(0) #endif thanks, Dave Cui, Dexuan wrote: >>diff -r f1508348ffab tools/libxc/xc_domain_restore.c >>... >>+#define rdtscll(val) do { \ >>+ unsigned int a,d; \ >>+ asm volatile("rdtsc" : "=a" (a), "=d" (d)); \ >>+ (val) = ((unsigned long)a) | (((unsigned long)d)<<32); \ >>+} while(0) >>+ >> /* max mfn of the current host machine */ >> static unsigned long max_mfn; >>... >> >> > >The "rdtscll" definition is buggy for __i386__ since sizeof "int" and "long" usually are 4 there. > >-- Dexuan > > >-----Original Message----- >From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ben Guthro >Sent: 2008Äê6ÔÂ5ÈÕ 23:00 >To: xen-devel; Dave Winchell >Subject: [Xen-devel] [PATCH 1/2] Migrate tsc values during migration > >Migrate the last TSC values for more accurate timekeeping during live >migration > >Signed-off-by: Dave Winchell >Signed-off-by: Ben Guthro > >