ia64/xen-unstable
changeset 9432:bb8a5d7e72a2
Fix 2 VMX 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
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
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
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Thu Mar 23 14:44:51 2006 +0100 (2006-03-23) |
parents | f3943890794a |
children | 401624a17ef7 |
files | xen/arch/x86/hvm/vmx/io.c xen/arch/x86/hvm/vmx/vmx.c |
line diff
1.1 --- a/xen/arch/x86/hvm/vmx/io.c Thu Mar 23 14:34:35 2006 +0100 1.2 +++ b/xen/arch/x86/hvm/vmx/io.c Thu Mar 23 14:44:51 2006 +0100 1.3 @@ -86,7 +86,7 @@ interrupt_post_injection(struct vcpu * v 1.4 } 1.5 vpit->inject_point = NOW(); 1.6 1.7 - vpit->last_pit_gtime += vpit->period; 1.8 + vpit->last_pit_gtime += vpit->period_cycles; 1.9 set_guest_time(v, vpit->last_pit_gtime); 1.10 } 1.11 1.12 @@ -206,8 +206,11 @@ void vmx_do_resume(struct vcpu *v) 1.13 vmx_stts(); 1.14 1.15 /* pick up the elapsed PIT ticks and re-enable pit_timer */ 1.16 - if ( vpit->first_injected) { 1.17 - set_guest_time(v, v->domain->arch.hvm_domain.guest_time); 1.18 + if ( vpit->first_injected ) { 1.19 + if ( v->domain->arch.hvm_domain.guest_time ) { 1.20 + set_guest_time(v, v->domain->arch.hvm_domain.guest_time); 1.21 + v->domain->arch.hvm_domain.guest_time = 0; 1.22 + } 1.23 pickup_deactive_ticks(vpit); 1.24 } 1.25
2.1 --- a/xen/arch/x86/hvm/vmx/vmx.c Thu Mar 23 14:34:35 2006 +0100 2.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c Thu Mar 23 14:44:51 2006 +0100 2.3 @@ -358,9 +358,10 @@ static void vmx_freeze_time(struct vcpu 2.4 { 2.5 struct hvm_virpit *vpit = &v->domain->arch.hvm_domain.vpit; 2.6 2.7 - v->domain->arch.hvm_domain.guest_time = get_guest_time(v); 2.8 - if ( vpit->first_injected ) 2.9 + if ( vpit->first_injected && !v->domain->arch.hvm_domain.guest_time ) { 2.10 + v->domain->arch.hvm_domain.guest_time = get_guest_time(v); 2.11 stop_timer(&(vpit->pit_timer)); 2.12 + } 2.13 } 2.14 2.15 static void vmx_ctxt_switch_from(struct vcpu *v)