|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v3 4/6] vpt: split part of pt_intr_post into a separate helper
No functional change.
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/arch/x86/hvm/vpt.c | 67 +++++++++++++++++++++++-------------------
1 file changed, 36 insertions(+), 31 deletions(-)
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index a0cc61fd28..2565f7237e 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -265,6 +265,41 @@ static void pt_timer_fn(void *data)
pt_unlock(pt);
}
+static void pt_irq_fired(struct vcpu *v, struct periodic_time *pt)
+{
+ pt->irq_issued = 0;
+
+ if ( pt->one_shot )
+ {
+ if ( pt->on_list )
+ list_del(&pt->list);
+ 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->last_plt_gtime += pt->period;
+ if ( --pt->pending_intr_nr == 0 )
+ {
+ pt_process_missed_ticks(pt);
+ if ( pt->pending_intr_nr == 0 )
+ set_timer(&pt->timer, pt->scheduled);
+ }
+ }
+
+ if ( mode_is(v->domain, delay_for_missed_ticks) &&
+ (hvm_get_guest_time(v) < pt->last_plt_gtime) )
+ hvm_set_guest_time(v, pt->last_plt_gtime);
+}
+
int pt_update_irq(struct vcpu *v)
{
struct list_head *head = &v->arch.hvm_vcpu.tm_list;
@@ -386,37 +421,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
return;
}
- pt->irq_issued = 0;
-
- if ( pt->one_shot )
- {
- if ( pt->on_list )
- list_del(&pt->list);
- 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->last_plt_gtime += pt->period;
- if ( --pt->pending_intr_nr == 0 )
- {
- pt_process_missed_ticks(pt);
- if ( pt->pending_intr_nr == 0 )
- set_timer(&pt->timer, pt->scheduled);
- }
- }
-
- if ( mode_is(v->domain, delay_for_missed_ticks) &&
- (hvm_get_guest_time(v) < pt->last_plt_gtime) )
- hvm_set_guest_time(v, pt->last_plt_gtime);
+ pt_irq_fired(v, pt);
cb = pt->cb;
cb_priv = pt->priv;
--
2.17.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |