aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vpt.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-09-25 15:20:58 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-09-25 15:20:58 +0100
commitb5c3ec16ff2a53b88ad1c12e2c534f305ada4478 (patch)
tree059981ccb6c92da46a5dd83ae701c4d126cf44d1 /xen/arch/x86/hvm/vpt.c
parent1b506ca9b0c7cb92003c6603c0bf2347077a5a54 (diff)
downloadxen-b5c3ec16ff2a53b88ad1c12e2c534f305ada4478.tar.gz
xen-b5c3ec16ff2a53b88ad1c12e2c534f305ada4478.tar.bz2
xen-b5c3ec16ff2a53b88ad1c12e2c534f305ada4478.zip
x86 hvm: *really* fix missing ticks bug of c/s 20218
With c/s 20218, timer ticks might be missed when IRQs of a timer are queued. "Next scheduled time" is accumulated wrongly. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/vpt.c')
-rw-r--r--xen/arch/x86/hvm/vpt.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 5ed1362082..9a0bb06429 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -206,6 +206,7 @@ static void pt_timer_fn(void *data)
pt_lock(pt);
pt->pending_intr_nr++;
+ pt->scheduled += pt->period;
pt->do_not_freeze = 0;
vcpu_kick(pt->vcpu);
@@ -306,27 +307,22 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
pt->on_list = 0;
pt->pending_intr_nr = 0;
}
+ else if ( mode_is(v->domain, one_missed_tick_pending) ||
+ mode_is(v->domain, no_missed_ticks_pending) )
+ {
+ pt->last_plt_gtime = hvm_get_guest_time(v);
+ pt_process_missed_ticks(pt);
+ pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
+ set_timer(&pt->timer, pt->scheduled);
+ }
else
{
- pt->scheduled += pt->period;
-
- if ( mode_is(v->domain, one_missed_tick_pending) ||
- mode_is(v->domain, no_missed_ticks_pending) )
- {
- pt->last_plt_gtime = hvm_get_guest_time(v);
- pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */
- }
- else
- {
- pt->last_plt_gtime += pt->period;
- pt->pending_intr_nr--;
- }
-
- if ( pt->pending_intr_nr == 0 )
+ pt->last_plt_gtime += pt->period;
+ if ( --pt->pending_intr_nr == 0 )
{
pt_process_missed_ticks(pt);
- pt->do_not_freeze = 0;
- set_timer(&pt->timer, pt->scheduled);
+ if ( pt->pending_intr_nr == 0 )
+ set_timer(&pt->timer, pt->scheduled);
}
}