Skip to contentSkip to conversation

virtual time bugfix

PATCH New Yang, Xiaowei 1 participant 1 message Mar 23, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtual time bugfix

Keir,
This patch fixes 2 time related bugs: 1) bogomips=0 or a very huge number after booting ia32/ia32e vmx 2) Repeated keys show in Xwindow terminal after one key is pressed.

Xiaowei

xen/arch/x86/hvm/vmx/io.c +6 -3
diff -r d81636a6fa9f xen/arch/x86/hvm/vmx/io.c
@@ -86,7 +86,7 @@
         }
         vpit->inject_point = NOW();
 
-        vpit->last_pit_gtime += vpit->period;
+        vpit->last_pit_gtime += vpit->period_cycles;
         set_guest_time(v, vpit->last_pit_gtime);
     }
 
@@ -206,8 +206,11 @@
     vmx_stts();
 
     /* pick up the elapsed PIT ticks and re-enable pit_timer */
-    if ( vpit->first_injected) {
-        set_guest_time(v, v->domain->arch.hvm_domain.guest_time);
+    if ( vpit->first_injected ) {
+        if ( v->domain->arch.hvm_domain.guest_time ) {
+            set_guest_time(v, v->domain->arch.hvm_domain.guest_time);
+            v->domain->arch.hvm_domain.guest_time = 0;
+        }
         pickup_deactive_ticks(vpit);
     }
 
xen/arch/x86/hvm/vmx/vmx.c +3 -2
diff -r d81636a6fa9f xen/arch/x86/hvm/vmx/vmx.c
@@ -358,9 +358,10 @@
 {
     struct hvm_virpit *vpit = &v->domain->arch.hvm_domain.vpit;
     
-    v->domain->arch.hvm_domain.guest_time = get_guest_time(v);
-    if ( vpit->first_injected )
+    if ( vpit->first_injected && !v->domain->arch.hvm_domain.guest_time ) {
+        v->domain->arch.hvm_domain.guest_time = get_guest_time(v);
         stop_timer(&(vpit->pit_timer));
+    }
 }
 
 static void vmx_ctxt_switch_from(struct vcpu *v)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel