ia64/xen-unstable

changeset 14244:156f2644eb06

[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@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Fri Dec 15 08:36:03 2006 -0500 (2006-12-15)
parents fdb3c96eba0f
children 5a2b3a1b1f63
files xen/arch/powerpc/exceptions.c
line diff
     1.1 --- a/xen/arch/powerpc/exceptions.c	Thu Feb 08 07:05:26 2007 -0500
     1.2 +++ b/xen/arch/powerpc/exceptions.c	Fri Dec 15 08:36:03 2006 -0500
     1.3 @@ -35,7 +35,9 @@
     1.4  extern ulong ppc_do_softirq(ulong orig_msr);
     1.5  extern void do_timer(struct cpu_user_regs *regs);
     1.6  extern void do_dec(struct cpu_user_regs *regs);
     1.7 -extern void program_exception(struct cpu_user_regs *regs, unsigned long cookie);
     1.8 +extern void program_exception(struct cpu_user_regs *regs,
     1.9 +                              unsigned long cookie);
    1.10 +extern int reprogram_timer(s_time_t timeout); 
    1.11  
    1.12  int hdec_sample = 0;
    1.13  
    1.14 @@ -43,7 +45,20 @@ void do_timer(struct cpu_user_regs *regs
    1.15  {
    1.16      /* Set HDEC high so it stops firing and can be reprogrammed by
    1.17       * set_preempt() */
    1.18 -    mthdec(INT_MAX);
    1.19 +    /* FIXME! HACK ALERT!
    1.20 +     *
    1.21 +     * We have a bug in that if we switch domains in schedule() we
    1.22 +     * switch right away regardless of whatever else is pending.  This
    1.23 +     * means that if the timer goes off while in schedule(), the next
    1.24 +     * domain will be preempted by the interval defined below.  So
    1.25 +     * until we fix our cotnext_switch(), the follow workaround will
    1.26 +     * make sure that the domain we switch to does not run for to long
    1.27 +     * so we can continue to service the other timers in the timer
    1.28 +     * queue and that the value is long enough to escape this
    1.29 +     * particular timer event.
    1.30 +     */
    1.31 +    reprogram_timer(NOW() + MILLISECS(1));
    1.32 +
    1.33      raise_softirq(TIMER_SOFTIRQ);
    1.34  }
    1.35