All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add a timer mode that disables pending missed ticks
@ 2007-10-30 14:28 Shan, Haitao
  2007-10-30 16:12 ` Keir Fraser
  0 siblings, 1 reply; 78+ messages in thread
From: Shan, Haitao @ 2007-10-30 14:28 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel, Dong, Eddie, Jiang, Yunhong


[-- Attachment #1.1: Type: text/plain, Size: 245 bytes --]

Hi, Keir,

This patch adds a new timer mode, in which no missed ticks is
calculated. This can be used with latest x86_64 linux guest, since it
can pick up missed ticks themselves.
 <<no_missed_ticks.patch>> 

Best Regards
Haitao Shan


[-- Attachment #1.2: Type: text/html, Size: 924 bytes --]

[-- Attachment #2: no_missed_ticks.patch --]
[-- Type: application/octet-stream, Size: 2348 bytes --]

diff -r 4b4c75cb6c0f xen/arch/x86/hvm/vpt.c
--- a/xen/arch/x86/hvm/vpt.c	Tue Oct 30 11:05:36 2007 +0000
+++ b/xen/arch/x86/hvm/vpt.c	Tue Oct 30 05:45:57 2007 +0800
@@ -25,8 +25,16 @@
 
 static int pt_support_time_frozen(struct domain *d)
 {
-    return (d->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] == 
-            HVMPTM_delay_for_missed_ticks);
+    return ( d->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] ==
+            HVMPTM_delay_for_missed_ticks
+          || d->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] ==
+            HVMPTM_delay_for_missed_ticks );
+}
+
+static int pt_support_no_missed_ticks(struct domain *d)
+{
+    return (d->arch.hvm_domain.params[HVM_PARAM_TIMER_MODE] ==
+            HVMPTM_no_missed_ticks_pending);
 }
 
 static void pt_lock(struct periodic_time *pt)
@@ -115,7 +123,8 @@ void pt_restore_timer(struct vcpu *v)
 
     list_for_each_entry ( pt, head, list )
     {
-        missed_ticks(pt);
+        if ( !pt_support_no_missed_ticks(v->domain) )
+            missed_ticks(pt);
         set_timer(&pt->timer, pt->scheduled);
     }
 
@@ -136,7 +145,13 @@ static void pt_timer_fn(void *data)
     if ( !pt->one_shot )
     {
         pt->scheduled += pt->period;
-        missed_ticks(pt);
+        if ( !pt_support_no_missed_ticks(pt->vcpu->domain) )
+            missed_ticks(pt);
+        else if ( NOW() - pt->scheduled >= 0  )
+        {
+            pt->pending_intr_nr++;
+            pt->scheduled = NOW() + pt->period;
+        }
         set_timer(&pt->timer, pt->scheduled);
     }
 
@@ -233,7 +248,10 @@ void pt_intr_post(struct vcpu *v, struct
     else
     {
         pt->pending_intr_nr--;
-        pt->last_plt_gtime += pt->period_cycles;
+        if ( pt_support_no_missed_ticks(v->domain) )
+            pt->last_plt_gtime = hvm_get_guest_time(v);
+        else
+            pt->last_plt_gtime += pt->period_cycles;
     }
 
     if ( pt_support_time_frozen(v->domain) &&
diff -r 4b4c75cb6c0f xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h	Tue Oct 30 11:05:36 2007 +0000
+++ b/xen/include/public/hvm/params.h	Tue Oct 30 05:13:32 2007 +0800
@@ -70,6 +70,7 @@
 #define HVM_PARAM_TIMER_MODE   10
 #define HVMPTM_delay_for_missed_ticks    0
 #define HVMPTM_no_delay_for_missed_ticks 1
+#define HVMPTM_no_missed_ticks_pending   2
 
 #define HVM_NR_PARAMS          11
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2008-03-06 23:36 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 14:28 [PATCH] Add a timer mode that disables pending missed ticks Shan, Haitao
2007-10-30 16:12 ` Keir Fraser
2007-10-30 21:16   ` Dave Winchell
2007-10-31  7:09     ` Keir Fraser
2007-11-01 21:14       ` Dave Winchell
2007-11-01 21:21         ` Dave Winchell
2007-11-02  9:40         ` Keir Fraser
2007-11-02 15:51           ` Dave Winchell
2007-11-02 16:14             ` Keir Fraser
2007-11-02 16:35               ` Keir Fraser
2007-11-02 18:05               ` Dave Winchell
2007-11-03 21:17                 ` Dave Winchell
2007-11-03 22:31                   ` Keir Fraser
2007-11-05 14:36                     ` Dave Winchell
2007-11-07 14:39                       ` Dave Winchell
2007-11-07 14:39                         ` Keir Fraser
2007-11-07 16:23                           ` Dave Winchell
2007-11-07 17:10                             ` Keir Fraser
2007-11-07 17:29                               ` Keir Fraser
2007-11-07 17:47                                 ` Keir Fraser
2007-11-07 19:38                                   ` Dave Winchell
2007-11-08  8:07                                     ` Keir Fraser
2007-11-08 14:43                                       ` Dave Winchell
2007-11-08 14:53                                         ` Keir Fraser
2007-11-08 15:08                                           ` Dave Winchell
2007-11-09 19:22                                           ` Dave Winchell
2007-11-10 10:55                                             ` Keir Fraser
2007-11-12 15:37                                               ` Dave Winchell
2007-11-26 20:57                                               ` Dave Winchell
2007-12-06 11:57                                                 ` Keir Fraser
2007-12-19 18:57                                                   ` Dan Magenheimer
2007-12-19 19:32                                                     ` Dave Winchell
2008-01-03 22:57                                                       ` Dan Magenheimer
2008-01-03 23:24                                                         ` Dave Winchell
2008-01-04 23:24                                                         ` Dave Winchell
2008-01-08 14:33                                                           ` Keir Fraser
2008-01-09 16:53                                                             ` Dave Winchell
2008-01-09 17:19                                                               ` Dan Magenheimer
2008-01-09 19:14                                                                 ` Keir Fraser
2008-01-25 23:50                                                               ` Dan Magenheimer
2008-01-27 21:21                                                                 ` Dave Winchell
2008-01-28  0:29                                                                   ` Dan Magenheimer
2008-01-28 15:21                                                                     ` Dave Winchell
2008-01-29 22:34                                                                       ` Dan Magenheimer
2008-01-30 15:25                                                                         ` Dave Winchell
2008-01-30 21:04                                                                           ` Deepak Patel
2008-01-30 21:44                                                                             ` Dave Winchell
2008-02-01 22:31                                                                               ` Dan Magenheimer
2008-02-04 20:07                                                                                 ` Dave Winchell
2008-02-08 21:21                                                                                   ` Dave Winchell
2008-02-11 16:52                                                                                     ` Dave Winchell
2008-02-14 15:59                                                                                       ` Dave Winchell
2008-02-14 16:21                                                                                         ` Dan Magenheimer
2008-02-14 17:55                                                                                           ` Dave Winchell
2008-02-15 16:46                                                                                             ` Dan Magenheimer
2008-02-15 17:28                                                                                               ` Dave Winchell
2008-02-19 15:26                                                                                                 ` Dave Winchell
2008-02-19 17:55                                                                                                   ` Dan Magenheimer
2008-02-19 19:29                                                                                                     ` Keir Fraser
2008-02-19 20:50                                                                                                     ` Dave Winchell
2008-02-19 23:38                                                                                                       ` Dan Magenheimer
2008-02-20 23:40                                                                                                         ` Dan Magenheimer
2008-02-25 16:42                                                                                                       ` Dan Magenheimer
2008-02-25 20:01                                                                                                         ` (progress on hpet accuracy) and " Dave Winchell
2008-02-26  8:26                                                                                                           ` Keir Fraser
2008-02-26 14:45                                                                                                             ` Dave Winchell
2008-02-26 14:56                                                                                                               ` Keir Fraser
2008-02-26 15:49                                                                                                                 ` Dave Winchell
2008-03-05 15:06                                                                                                                 ` Dave Winchell
2008-03-05 15:20                                                                                                                   ` Keir Fraser
2008-03-05 17:25                                                                                                                     ` Dave Winchell
2008-03-05 17:21                                                                                                                       ` Keir Fraser
2008-03-05 17:42                                                                                                                         ` Dave Winchell
2008-03-05 17:53                                                                                                                           ` Dan Magenheimer
2008-03-06 23:36                                                                                                         ` Dan Magenheimer
2007-12-19 19:40                                                     ` Dave Winchell
2007-11-08 14:57                                         ` Dave Winchell
2007-10-31  3:10   ` Shan, Haitao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.