WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] hvm vlapic: Fix tmcct read logic when in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] hvm vlapic: Fix tmcct read logic when in periodic mode.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Dec 2010 05:33:39 -0800
Delivery-date: Thu, 23 Dec 2010 05:36:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1291999745 0
# Node ID 3b3fce9050b9b14f3a11123f6943998413ea7e7e
# Parent  901c118b363e978566775f9d118b4f2f15598212
hvm vlapic: Fix tmcct read logic when in periodic mode.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/x86/hvm/vlapic.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff -r 901c118b363e -r 3b3fce9050b9 xen/arch/x86/hvm/vlapic.c
--- a/xen/arch/x86/hvm/vlapic.c Fri Dec 10 16:40:05 2010 +0000
+++ b/xen/arch/x86/hvm/vlapic.c Fri Dec 10 16:49:05 2010 +0000
@@ -435,12 +435,19 @@ static uint32_t vlapic_get_tmcct(struct 
 static uint32_t vlapic_get_tmcct(struct vlapic *vlapic)
 {
     struct vcpu *v = current;
-    uint32_t tmcct, tmict = vlapic_get_reg(vlapic, APIC_TMICT);
+    uint32_t tmcct = 0, tmict = vlapic_get_reg(vlapic, APIC_TMICT);
     uint64_t counter_passed;
 
     counter_passed = ((hvm_get_guest_time(v) - vlapic->timer_last_update)
-                      / APIC_BUS_CYCLE_NS / vlapic->hw.timer_divisor);
-    tmcct = (counter_passed < tmict) ? tmict - counter_passed : 0;
+                      / (APIC_BUS_CYCLE_NS * vlapic->hw.timer_divisor));
+
+    if ( tmict != 0 )
+    {
+        if ( vlapic_lvtt_period(vlapic) )
+            counter_passed %= tmict;
+        if ( counter_passed < tmict )
+            tmcct = tmict - counter_passed;
+    }
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER,
                 "timer initial count %d, timer current count %d, "

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] hvm vlapic: Fix tmcct read logic when in periodic mode., Xen patchbot-unstable <=