[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86: don't pass negative time to gtime_to_gtsc()



commit eb60be3dd870aecfa47bed1118069680389c15f7
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Apr 11 12:07:55 2013 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Apr 11 12:07:55 2013 +0200

    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@xxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
---
 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 b403f47..6e94847 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -854,7 +854,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);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.