aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-23 14:44:51 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-23 14:44:51 +0100
commit5b7966f9128b094b842141ff55f9551018de1fff (patch)
tree879aa535a6ad2a218bb7cd796e0dcd81104e9f47
parent98009c2ad02f691d9418095cf3e7b65bffdd588b (diff)
downloadxen-5b7966f9128b094b842141ff55f9551018de1fff.tar.gz
xen-5b7966f9128b094b842141ff55f9551018de1fff.tar.bz2
xen-5b7966f9128b094b842141ff55f9551018de1fff.zip
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>
-rw-r--r--xen/arch/x86/hvm/vmx/io.c9
-rw-r--r--xen/arch/x86/hvm/vmx/vmx.c5
2 files changed, 9 insertions, 5 deletions
diff --git a/xen/arch/x86/hvm/vmx/io.c b/xen/arch/x86/hvm/vmx/io.c
index 1a862894ae..18c793f843 100644
--- a/xen/arch/x86/hvm/vmx/io.c
+++ b/xen/arch/x86/hvm/vmx/io.c
@@ -86,7 +86,7 @@ interrupt_post_injection(struct vcpu * v, int vector, int type)
}
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 @@ void vmx_do_resume(struct vcpu *v)
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);
}
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 0235d066f9..fcca96efdb 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -358,9 +358,10 @@ static void vmx_freeze_time(struct vcpu *v)
{
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)