From: Kouya Shimura Subject: [PATCH] x86,hvm: cleanup vpt.c,vpt.h Date: Tue, 28 Jul 2009 14:37:57 +0900 Message-ID: <7kprblcqq1.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="yd7z4UIwQ6" 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 List-Id: xen-devel@lists.xenproject.org --yd7z4UIwQ6 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit In struct periodic_time, pt->period_cycles is not cpu cycles since c/s 17716 and its value is always the same as pt->period. Signed-off-by: Kouya Shimura --yd7z4UIwQ6 Content-Type: text/x-patch Content-Disposition: inline; filename="vpt.patch" Content-Transfer-Encoding: 7bit diff -r 8af26fef898c xen/arch/x86/hvm/vpt.c --- a/xen/arch/x86/hvm/vpt.c Fri Jul 24 12:08:54 2009 +0100 +++ b/xen/arch/x86/hvm/vpt.c Tue Jul 28 14:18:02 2009 +0900 @@ -230,9 +230,9 @@ void pt_update_irq(struct vcpu *v) list_for_each_entry ( pt, head, list ) { if ( !pt_irq_masked(pt) && pt->pending_intr_nr && - ((pt->last_plt_gtime + pt->period_cycles) < max_lag) ) + ((pt->last_plt_gtime + pt->period) < max_lag) ) { - max_lag = pt->last_plt_gtime + pt->period_cycles; + max_lag = pt->last_plt_gtime + pt->period; earliest_pt = pt; } } @@ -309,7 +309,7 @@ void pt_intr_post(struct vcpu *v, struct } else { - pt->last_plt_gtime += pt->period_cycles; + pt->last_plt_gtime += pt->period; pt->pending_intr_nr--; } } @@ -385,7 +385,6 @@ void create_periodic_time( pt->vcpu = v; pt->last_plt_gtime = hvm_get_guest_time(pt->vcpu); pt->irq = irq; - pt->period_cycles = (u64)period; pt->one_shot = !period; pt->scheduled = NOW() + delta; diff -r 8af26fef898c xen/include/asm-x86/hvm/vpt.h --- a/xen/include/asm-x86/hvm/vpt.h Fri Jul 24 12:08:54 2009 +0100 +++ b/xen/include/asm-x86/hvm/vpt.h Tue Jul 28 14:18:02 2009 +0900 @@ -51,7 +51,6 @@ struct periodic_time { struct vcpu *vcpu; /* vcpu timer interrupt delivers to */ u32 pending_intr_nr; /* pending timer interrupts */ u64 period; /* frequency in ns */ - u64 period_cycles; /* frequency in cpu cycles */ s_time_t scheduled; /* scheduled timer interrupt */ u64 last_plt_gtime; /* platform time when last IRQ is injected */ struct timer timer; /* ac_timer */ --yd7z4UIwQ6 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 --yd7z4UIwQ6--