From: Kouya Shimura Subject: [PATCH] x86 hvm: fix missing ticks issue in c/s 20218 Date: Fri, 25 Sep 2009 13:37:41 +0900 Message-ID: <7kzl8jprl5.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="znMSYs8kWz" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Christoph Egger , Keir Fraser List-Id: xen-devel@lists.xenproject.org --znMSYs8kWz Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Although c/s 20229 fixes missing ticks issue in c/s 20218, it's not enough. - set a timer to the next period more straightforwardly. - fix an unexpected behavior of both timer_mode=2 and timer_mode=3. extra interrupts might be delivered to a guest. Signed-off-by: Kouya Shimura --znMSYs8kWz Content-Type: text/x-patch Content-Disposition: inline; filename="vpt_missing_ticks.patch" Content-Transfer-Encoding: 7bit diff -r 0f8376078dc1 xen/arch/x86/hvm/vpt.c --- a/xen/arch/x86/hvm/vpt.c Wed Sep 23 18:19:30 2009 +0100 +++ b/xen/arch/x86/hvm/vpt.c Thu Sep 24 17:19:56 2009 +0900 @@ -313,20 +313,23 @@ void pt_intr_post(struct vcpu *v, struct if ( mode_is(v->domain, one_missed_tick_pending) || mode_is(v->domain, no_missed_ticks_pending) ) { + pt_process_missed_ticks(pt); + set_timer(&pt->timer, pt->scheduled); + pt->last_plt_gtime = hvm_get_guest_time(v); pt->pending_intr_nr = 0; /* 'collapse' all missed ticks */ } else { + s_time_t now = NOW(); + + if ( pt->scheduled > now ) + { + set_timer(&pt->timer, pt->scheduled); + pt->pending_intr_nr = 0; + } + pt->last_plt_gtime += pt->period; - pt->pending_intr_nr--; - } - - if ( pt->pending_intr_nr == 0 ) - { - pt_process_missed_ticks(pt); - pt->do_not_freeze = 0; - set_timer(&pt->timer, pt->scheduled); } } --znMSYs8kWz Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --znMSYs8kWz--