Ben Guthro
2008-Jun-05 14:59 UTC
[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 <dwinchell@virtualiron.com> Signed-off-by: Ben Guthro <bguthro@virtualiron.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Cui, Dexuan
2008-Jun-06 02:42 UTC
RE: [Xen-devel] [PATCH 1/2] Migrate tsc values during migration
> 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 <dwinchell@virtualiron.com> Signed-off-by: Ben Guthro <bguthro@virtualiron.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dave Winchell
2008-Jun-06 14:49 UTC
Re: [Xen-devel] [PATCH 1/2] Migrate tsc values during migration
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 <dwinchell@virtualiron.com>
>Signed-off-by: Ben Guthro <bguthro@virtualiron.com>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel