ia64/xen-unstable

changeset 1404:d11b603a8ccf

bitkeeper revision 1.914 (40ab6d61x-o8a0EkAPFPNgH58cGauQ)

More TLB flush fixes.
author kaf24@scramble.cl.cam.ac.uk
date Wed May 19 14:21:21 2004 +0000 (2004-05-19)
parents 9bb84189678d
children 24e6ea32ed3c
files xen/arch/i386/flushtlb.c xen/arch/i386/setup.c xen/arch/i386/smp.c xen/common/softirq.c xen/include/xen/interrupt.h
line diff
     1.1 --- a/xen/arch/i386/flushtlb.c	Wed May 19 12:10:16 2004 +0000
     1.2 +++ b/xen/arch/i386/flushtlb.c	Wed May 19 14:21:21 2004 +0000
     1.3 @@ -9,6 +9,7 @@
     1.4  
     1.5  #include <xen/config.h>
     1.6  #include <xen/sched.h>
     1.7 +#include <xen/interrupt.h>
     1.8  #include <asm/flushtlb.h>
     1.9  
    1.10  u32 tlbflush_clock;
    1.11 @@ -24,7 +25,7 @@ void tlb_clocktick(void)
    1.12  #ifdef CONFIG_SMP
    1.13          if ( unlikely(((y = ny+1) & TLBCLOCK_EPOCH_MASK) == 0) )
    1.14          {
    1.15 -            new_tlbflush_clock_period();
    1.16 +            raise_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ);
    1.17              y = tlbflush_clock;
    1.18              break;
    1.19          }
     2.1 --- a/xen/arch/i386/setup.c	Wed May 19 12:10:16 2004 +0000
     2.2 +++ b/xen/arch/i386/setup.c	Wed May 19 14:21:21 2004 +0000
     2.3 @@ -345,6 +345,10 @@ void __init start_of_day(void)
     2.4      memguard_guard_range(cpu0_stack, PAGE_SIZE);
     2.5  #endif
     2.6  
     2.7 +    open_softirq(NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ, 
     2.8 +                 (void *)new_tlbflush_clock_period,
     2.9 +                 NULL);
    2.10 +
    2.11      if ( opt_watchdog ) 
    2.12          nmi_watchdog = NMI_LOCAL_APIC;
    2.13  
     3.1 --- a/xen/arch/i386/smp.c	Wed May 19 12:10:16 2004 +0000
     3.2 +++ b/xen/arch/i386/smp.c	Wed May 19 14:21:21 2004 +0000
     3.3 @@ -288,11 +288,13 @@ void flush_tlb_mask(unsigned long mask)
     3.4      }
     3.5  }
     3.6  
     3.7 +/*
     3.8 + * NB. Must be called with no locks held and interrupts enabled.
     3.9 + *     (e.g., softirq context).
    3.10 + */
    3.11  void new_tlbflush_clock_period(void)
    3.12  {
    3.13 -    /* Avoid deadlock because we might be reentering a flush_lock region. */
    3.14 -    if ( unlikely(!spin_trylock(&flush_lock)) )
    3.15 -        return;
    3.16 +    spin_lock(&flush_lock);
    3.17  
    3.18      /* Someone may acquire the lock and execute the flush before us. */
    3.19      if ( ((tlbflush_clock+1) & TLBCLOCK_EPOCH_MASK) != 0 )
     4.1 --- a/xen/common/softirq.c	Wed May 19 12:10:16 2004 +0000
     4.2 +++ b/xen/common/softirq.c	Wed May 19 14:21:21 2004 +0000
     4.3 @@ -61,7 +61,7 @@ inline void cpu_raise_softirq(unsigned i
     4.4  
     4.5  void raise_softirq(unsigned int nr)
     4.6  {
     4.7 -    cpu_raise_softirq(smp_processor_id(), nr);
     4.8 +    __cpu_raise_softirq(smp_processor_id(), nr);
     4.9  }
    4.10  
    4.11  void open_softirq(int nr, void (*action)(struct softirq_action*), void *data)
     5.1 --- a/xen/include/xen/interrupt.h	Wed May 19 12:10:16 2004 +0000
     5.2 +++ b/xen/include/xen/interrupt.h	Wed May 19 14:21:21 2004 +0000
     5.3 @@ -42,7 +42,8 @@ enum
     5.4  	AC_TIMER_SOFTIRQ,
     5.5  	TASKLET_SOFTIRQ,
     5.6          BLKDEV_RESPONSE_SOFTIRQ,
     5.7 -        NET_TX_SOFTIRQ
     5.8 +        NET_TX_SOFTIRQ,
     5.9 +        NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ
    5.10  };
    5.11  
    5.12  /* softirq mask and active fields moved to irq_cpustat_t in