diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-17 13:12:03 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-17 13:12:03 +0100 |
commit | f69c1f0351bf67ff1abc06eb0d40dd1120e92c5a (patch) | |
tree | 1db3329ec62a309131b36f3f76b81389c75dfc8e /xen/arch/x86/hvm/vpt.c | |
parent | e3ca52c27088f0e03124ed5b540839cb583cf283 (diff) | |
download | xen-f69c1f0351bf67ff1abc06eb0d40dd1120e92c5a.tar.gz xen-f69c1f0351bf67ff1abc06eb0d40dd1120e92c5a.tar.bz2 xen-f69c1f0351bf67ff1abc06eb0d40dd1120e92c5a.zip |
hvm: Fix one-shot timers. Do not disable until the interrupt has been
latched by the target VCPU.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/hvm/vpt.c')
-rw-r--r-- | xen/arch/x86/hvm/vpt.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index 5ca2968d3c..743f19eaa0 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -46,7 +46,7 @@ static void missed_ticks(struct periodic_time *pt) { s_time_t missed_ticks; - if ( unlikely(pt->one_shot) ) + if ( pt->one_shot ) return; missed_ticks = NOW() - pt->scheduled; @@ -115,12 +115,7 @@ static void pt_timer_fn(void *data) pt->pending_intr_nr++; - if ( unlikely(pt->one_shot) ) - { - pt->enabled = 0; - list_del(&pt->list); - } - else + if ( !pt->one_shot ) { pt->scheduled += pt->period; missed_ticks(pt); @@ -212,10 +207,16 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack) return; } - ASSERT(pt->vcpu == v); - - pt->pending_intr_nr--; - pt->last_plt_gtime += pt->period_cycles; + if ( pt->one_shot ) + { + pt->enabled = 0; + list_del(&pt->list); + } + else + { + pt->pending_intr_nr--; + pt->last_plt_gtime += pt->period_cycles; + } if ( hvm_get_guest_time(v) < pt->last_plt_gtime ) hvm_set_guest_time(v, pt->last_plt_gtime); |