x86 hvm: fix missing ticks bug of c/s 20218
PATCH 1/1 x86 hvm: 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.
Thanks to Christoph for the report.
Thanks,
Kouya
xen/arch/x86/hvm/vpt.c +5 -3
@@ -308,9 +308,6 @@ void pt_intr_post(struct vcpu *v, struct }else { - pt->scheduled += pt->period; -pt_process_missed_ticks (pt); -if (mode_is (v->domain, one_missed_tick_pending) ||mode_is (v->domain, no_missed_ticks_pending) ) {
@@ -324,7 +321,12 @@ void pt_intr_post(struct vcpu *v, struct }if ( pt->pending_intr_nr ==0 ) + { + pt->scheduled += pt->period; +pt_process_missed_ticks (pt); + pt->do_not_freeze =0 ;set_timer (&pt->timer, pt->scheduled); + } } if ( mode_is(v->domain, delay_for_missed_ticks) &&
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Moving the line 'pt->scheduled += pt->period' inside the if statement looks pretty dubious. Does your fix still work if we don't move that line? For the default timer mode I'm not sure it should make any difference either way, but it would for timer mode 0.
-- Keir
Quoted 11 lines · Kouya Shimura
With c/s 20218, timer ticks might be missed when IRQs of a timer are queued. Next scheduled time is accumulated wrongly.
Thanks to Christoph for the report.
Thanks,
KouyaSigned-off-by Kouya Shimura <[email protected]>Reported-by Christoph Egger <[email protected]>
Quoted 4 lines · Keir Fraser
Moving the line '
pt->scheduled+=pt->period' inside the if statement looks pretty dubious. Does your fix still work if we don't move that line? For the default timer mode I'm not sure it should make any difference either way, but it would for timer mode 0.
Oops, my brain was dead. You are right.
New one is attached. Of course it works.
Thanks,
Kouya
Quoted 17 lines
-- Keir
Quoted 11 lines · Kouya Shimura
With c/s 20218, timer ticks might be missed when IRQs of a timer are queued. Next scheduled time is accumulated wrongly.
Thanks to Christoph for the report.
Thanks,
KouyaSigned-off-by Kouya Shimura <[email protected]>Reported-by Christoph Egger <[email protected]>
xen/arch/x86/hvm/vpt.c +4 -1
@@ -309,7 +309,6 @@ void pt_intr_post(struct vcpu *v, structelse { pt->scheduled += pt->period; -pt_process_missed_ticks (pt);if (mode_is (v->domain, one_missed_tick_pending) ||mode_is (v->domain, no_missed_ticks_pending) )
@@ -324,7 +323,11 @@ void pt_intr_post(struct vcpu *v, struct }if ( pt->pending_intr_nr ==0 ) + { +pt_process_missed_ticks (pt); + pt->do_not_freeze =0 ;set_timer (&pt->timer, pt->scheduled); + } } if ( mode_is(v->domain, delay_for_missed_ticks) &&
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel