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

[XenPPC] [xenppc-unstable] [XEN][POWERPC] workaround for context_switch(

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [XEN][POWERPC] workaround for context_switch() bug
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Mar 2007 04:26:29 -0700
Delivery-date: Thu, 22 Mar 2007 07:06:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Date 1166189763 18000
# Node ID 156f2644eb062bc57e42747a745a8bac077e8d7b
# Parent  fdb3c96eba0f8d898dd5e734598ddc671114f1a1
[XEN][POWERPC] workaround for context_switch() bug
 We have a bug in that if we switch domains in schedule() we switch
 right away regardless of whatever else is pending.  This means that
 if the timer goes off while in schedule(), the next domain will be
 preempted by the interval defined below.  So until we fix our
 cotnext_switch(), the follow workaround will make sure that the
 domain we switch to does not run for to long so we can continue to
 service the other timers in the timer queue and that the value is
 long enough to escape this particular timer event.
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 xen/arch/powerpc/exceptions.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff -r fdb3c96eba0f -r 156f2644eb06 xen/arch/powerpc/exceptions.c
--- a/xen/arch/powerpc/exceptions.c     Thu Feb 08 07:05:26 2007 -0500
+++ b/xen/arch/powerpc/exceptions.c     Fri Dec 15 08:36:03 2006 -0500
@@ -35,7 +35,9 @@ extern ulong ppc_do_softirq(ulong orig_m
 extern ulong ppc_do_softirq(ulong orig_msr);
 extern void do_timer(struct cpu_user_regs *regs);
 extern void do_dec(struct cpu_user_regs *regs);
-extern void program_exception(struct cpu_user_regs *regs, unsigned long 
cookie);
+extern void program_exception(struct cpu_user_regs *regs,
+                              unsigned long cookie);
+extern int reprogram_timer(s_time_t timeout); 
 
 int hdec_sample = 0;
 
@@ -43,7 +45,20 @@ void do_timer(struct cpu_user_regs *regs
 {
     /* Set HDEC high so it stops firing and can be reprogrammed by
      * set_preempt() */
-    mthdec(INT_MAX);
+    /* FIXME! HACK ALERT!
+     *
+     * We have a bug in that if we switch domains in schedule() we
+     * switch right away regardless of whatever else is pending.  This
+     * means that if the timer goes off while in schedule(), the next
+     * domain will be preempted by the interval defined below.  So
+     * until we fix our cotnext_switch(), the follow workaround will
+     * make sure that the domain we switch to does not run for to long
+     * so we can continue to service the other timers in the timer
+     * queue and that the value is long enough to escape this
+     * particular timer event.
+     */
+    reprogram_timer(NOW() + MILLISECS(1));
+
     raise_softirq(TIMER_SOFTIRQ);
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [XEN][POWERPC] workaround for context_switch() bug, Xen patchbot-xenppc-unstable <=