Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 4585

kernel-2.6.18-194.11.1.el5.src.rpm

From: Rik van Riel <riel@redhat.com>
Date: Mon, 13 Apr 2009 12:06:45 -0400
Subject: [xen] x86: initialize vlapic->timer_last_update
Message-id: 20090413120645.141b6439@bree.surriel.com
O-Subject: [RHEL 5.4 PATCH 1/5] initialize vlapic->timer_last_update (bz 449346)
Bugzilla: 449346
RH-Acked-by: Justin M. Forbes <jforbes@redhat.com>
RH-Acked-by: Chris Lalancette <clalance@redhat.com>
RH-Acked-by: Don Dutile <ddutile@redhat.com>

Initialize vlapic->timer_last_update

Fixes bug 449346

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1196962487 0
# Node ID 42ce3cbd17ccc4fc0e81ea58af737c73ad1c008b
# Parent  3b423ab38b7ae6e27fdf3407ecf903b07f863575
hvm: Initialize vlapic->timer_last_update.

Without the fix, before the first vlapic timer interrupt is injected,
the "vlapic->timer_last_update" in vlapic_get_tmcct()  is always 0,
causing a wrong value of counter_passed.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen-unstable changeset:   16536:89e7031e153c62b9ce223a58a7ba49df285784a7
xen-unstable date:        Wed Dec 05 14:01:39 2007 +0000

diff --git a/arch/x86/hvm/vlapic.c b/arch/x86/hvm/vlapic.c
index 36a4b80..38dd9e9 100644
--- a/arch/x86/hvm/vlapic.c
+++ b/arch/x86/hvm/vlapic.c
@@ -661,6 +661,7 @@ static void vlapic_write(struct vcpu *v, unsigned long address,
         vlapic_set_reg(vlapic, APIC_TMICT, val);
         create_periodic_time(current, &vlapic->pt, period, vlapic->pt.irq,
                              !vlapic_lvtt_period(vlapic), NULL, vlapic);
+        vlapic->timer_last_update = vlapic->pt.last_plt_gtime;
 
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC,
                     "bus cycle is %uns, "
@@ -820,6 +821,7 @@ static void lapic_rearm(struct vlapic *s)
         s->pt.irq = lvtt & APIC_VECTOR_MASK;
         create_periodic_time(vlapic_vcpu(s), &s->pt, period, s->pt.irq,
                              !vlapic_lvtt_period(s), NULL, s);
+        s->timer_last_update = s->pt.last_plt_gtime;
 
         printk("lapic_load to rearm the actimer:"
                     "bus cycle is %uns, "