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-devel

[Xen-devel] [PATCH] vmx-pit-reset2.patch

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] vmx-pit-reset2.patch
From: Arun Sharma <arun.sharma@xxxxxxxxx>
Date: Fri, 17 Jun 2005 13:32:34 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 17 Jun 2005 20:28:30 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
A VMX guest can reprogram the same PIT channel twice. We should not create
two ac_timers to handle this case.

Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

--- trunk/xen/arch/x86/vmx_intercept.c  (revision 1187)
+++ trunk/xen/arch/x86/vmx_intercept.c  (working copy)
@@ -214,6 +214,14 @@ void vmx_hooks_assist(struct exec_domain
 
     /* load init count*/
     if (p->state == STATE_IORESP_HOOK) { 
+        /* set up actimer, handle re-init */
+        if ( active_ac_timer(&(vpit->pit_timer)) ) {
+            VMX_DBG_LOG(DBG_LEVEL_1, "VMX_PIT: guest reset PIT with channel 
%lx!\n", (unsigned long) ((p->u.data >> 24) & 0x3) );
+            rem_ac_timer(&(vpit->pit_timer));
+        }
+        else
+            init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
+
         /* init count for this channel */
         vpit->init_val = (p->u.data & 0xFFFF) ; 
         /* frequency(ms) of pit */
@@ -248,9 +256,7 @@ void vmx_hooks_assist(struct exec_domain
 
         vpit->intr_bitmap = intr;
 
-        /* set up the actimer */
-        init_ac_timer(&vpit->pit_timer, pit_timer_fn, vpit, 0);
-        pit_timer_fn(vpit); /* timer seed */
+       set_ac_timer(&vpit->pit_timer, NOW() + MILLISECS(vpit->period));
 
         /*restore the state*/
         p->state = STATE_IORESP_READY;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] vmx-pit-reset2.patch, Arun Sharma <=