diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-04-18 15:28:44 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-04-18 15:28:44 +0200 |
commit | 4ea05d169a56b3010f8f4a48557471c457bb0654 (patch) | |
tree | 7e13dbc73abc6a0f99e0c7b3f58e6b65e67eba3b | |
parent | c57664c8ff56c7ec4b156ff09ee337e5cab43e6a (diff) | |
download | xen-4ea05d169a56b3010f8f4a48557471c457bb0654.tar.gz xen-4ea05d169a56b3010f8f4a48557471c457bb0654.tar.bz2 xen-4ea05d169a56b3010f8f4a48557471c457bb0654.zip |
x86: don't pass negative time to gtime_to_gtsc()
scale_delta(), which is being called by that function, doesn't cope
with that.
Also print a warning message, so hopefully we can eventually figure why
occasionally a negative value results from the calculation in the first
place.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
master commit: eb60be3dd870aecfa47bed1118069680389c15f7
master date: 2013-04-11 12:07:55 +0200
-rw-r--r-- | xen/arch/x86/time.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 468f822a12..a176b88df6 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -821,7 +821,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force) if ( is_hvm_domain(d) ) { struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time; + stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset; + if ( (s64)stime < 0 ) + { + printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64 + " (offsets %" PRId64 "/%" PRId64 ")\n", + d->domain_id, v->vcpu_id, stime, + pl->stime_offset, v->arch.hvm_vcpu.stime_offset); + stime = 0; + } } tsc_stamp = gtime_to_gtsc(d, stime); } |