ia64/xen-unstable

changeset 9570:387b6824ce29

Remove send_IPI_all, send_IPI_allbutself and send_IPI_self
shortcutting IPI functions. They're either unused or used so
frequently that we may as well simplify things and always use
send_IPI_mask.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Apr 03 16:35:06 2006 +0100 (2006-04-03)
parents 590c33d6097c
children 108a62015bf4
files xen/arch/x86/genapic/default.c xen/arch/x86/smp.c xen/include/asm-x86/genapic.h xen/include/asm-x86/mach-bigsmp/mach_ipi.h xen/include/asm-x86/mach-default/mach_ipi.h xen/include/asm-x86/mach-es7000/mach_ipi.h xen/include/asm-x86/mach-generic/mach_ipi.h xen/include/asm-x86/mach-summit/mach_ipi.h
line diff
     1.1 --- a/xen/arch/x86/genapic/default.c	Mon Apr 03 15:52:58 2006 +0100
     1.2 +++ b/xen/arch/x86/genapic/default.c	Mon Apr 03 16:35:06 2006 +0100
     1.3 @@ -18,15 +18,6 @@
     1.4  #include <asm/mach-default/mach_ipi.h>
     1.5  #include <asm/mach-default/mach_mpparse.h>
     1.6  
     1.7 -#ifdef CONFIG_HOTPLUG_CPU
     1.8 -#define DEFAULT_SEND_IPI	(1)
     1.9 -#else
    1.10 -#define DEFAULT_SEND_IPI	(0)
    1.11 -#endif
    1.12 -
    1.13 -int no_broadcast = DEFAULT_SEND_IPI;
    1.14 -integer_param("no_ipi_broadcast", no_broadcast);
    1.15 -
    1.16  /* should be called last. */
    1.17  static __init int probe_default(void)
    1.18  { 
    1.19 @@ -34,12 +25,3 @@ static __init int probe_default(void)
    1.20  } 
    1.21  
    1.22  struct genapic apic_default = APIC_INIT("default", probe_default); 
    1.23 -
    1.24 -static int __init print_ipi_mode(void)
    1.25 -{
    1.26 -	if (genapic == &apic_default)
    1.27 -		printk("Using IPI %sShortcut mode\n",
    1.28 -		       no_broadcast ? "No-" : "");
    1.29 -	return 0;
    1.30 -}
    1.31 -__initcall(print_ipi_mode);
     2.1 --- a/xen/arch/x86/smp.c	Mon Apr 03 15:52:58 2006 +0100
     2.2 +++ b/xen/arch/x86/smp.c	Mon Apr 03 16:35:06 2006 +0100
     2.3 @@ -21,6 +21,7 @@
     2.4  #include <asm/smpboot.h>
     2.5  #include <asm/hardirq.h>
     2.6  #include <mach_apic.h>
     2.7 +#include <mach_ipi.h>
     2.8  
     2.9  /*
    2.10   *	Some notes on x86 processor bugs affecting SMP operation:
    2.11 @@ -74,38 +75,6 @@ static inline int __prepare_ICR2 (unsign
    2.12      return SET_APIC_DEST_FIELD(mask);
    2.13  }
    2.14  
    2.15 -void __send_IPI_shortcut(unsigned int shortcut, int vector)
    2.16 -{
    2.17 -    /*
    2.18 -     * Subtle. In the case of the 'never do double writes' workaround
    2.19 -     * we have to lock out interrupts to be safe.  As we don't care
    2.20 -     * of the value read we use an atomic rmw access to avoid costly
    2.21 -     * cli/sti.  Otherwise we use an even cheaper single atomic write
    2.22 -     * to the APIC.
    2.23 -     */
    2.24 -    unsigned int cfg;
    2.25 -
    2.26 -    /*
    2.27 -     * Wait for idle.
    2.28 -     */
    2.29 -    apic_wait_icr_idle();
    2.30 -
    2.31 -    /*
    2.32 -     * No need to touch the target chip field
    2.33 -     */
    2.34 -    cfg = __prepare_ICR(shortcut, vector);
    2.35 -
    2.36 -    /*
    2.37 -     * Send the IPI. The write to APIC_ICR fires this off.
    2.38 -     */
    2.39 -    apic_write_around(APIC_ICR, cfg);
    2.40 -}
    2.41 -
    2.42 -void send_IPI_self(int vector)
    2.43 -{
    2.44 -    __send_IPI_shortcut(APIC_DEST_SELF, vector);
    2.45 -}
    2.46 -
    2.47  static inline void check_IPI_mask(cpumask_t cpumask)
    2.48  {
    2.49      /*
    2.50 @@ -116,9 +85,6 @@ static inline void check_IPI_mask(cpumas
    2.51      ASSERT(!cpus_empty(cpumask));
    2.52  }
    2.53  
    2.54 -/*
    2.55 - * This is only used on smaller machines.
    2.56 - */
    2.57  void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
    2.58  {
    2.59      unsigned long mask = cpus_addr(cpumask)[0];
    2.60 @@ -168,36 +134,33 @@ inline void send_IPI_mask_sequence(cpuma
    2.61  
    2.62      local_irq_save(flags);
    2.63  
    2.64 -    for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) {
    2.65 -        if (cpu_isset(query_cpu, mask)) {
    2.66 -		
    2.67 -            /*
    2.68 -             * Wait for idle.
    2.69 -             */
    2.70 -            apic_wait_icr_idle();
    2.71 +    for_each_cpu_mask( query_cpu, mask )
    2.72 +    {
    2.73 +        /*
    2.74 +         * Wait for idle.
    2.75 +         */
    2.76 +        apic_wait_icr_idle();
    2.77  		
    2.78 -            /*
    2.79 -             * prepare target chip field
    2.80 -             */
    2.81 -            cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu));
    2.82 -            apic_write_around(APIC_ICR2, cfg);
    2.83 +        /*
    2.84 +         * prepare target chip field
    2.85 +         */
    2.86 +        cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu));
    2.87 +        apic_write_around(APIC_ICR2, cfg);
    2.88  		
    2.89 -            /*
    2.90 -             * program the ICR
    2.91 -             */
    2.92 -            cfg = __prepare_ICR(0, vector);
    2.93 +        /*
    2.94 +         * program the ICR
    2.95 +         */
    2.96 +        cfg = __prepare_ICR(0, vector);
    2.97  			
    2.98 -            /*
    2.99 -             * Send the IPI. The write to APIC_ICR fires this off.
   2.100 -             */
   2.101 -            apic_write_around(APIC_ICR, cfg);
   2.102 -        }
   2.103 +        /*
   2.104 +         * Send the IPI. The write to APIC_ICR fires this off.
   2.105 +         */
   2.106 +        apic_write_around(APIC_ICR, cfg);
   2.107      }
   2.108 +
   2.109      local_irq_restore(flags);
   2.110  }
   2.111  
   2.112 -#include <mach_ipi.h>
   2.113 -
   2.114  static spinlock_t flush_lock = SPIN_LOCK_UNLOCKED;
   2.115  static cpumask_t flush_cpumask;
   2.116  static unsigned long flush_va;
   2.117 @@ -241,20 +204,12 @@ void __flush_tlb_mask(cpumask_t mask, un
   2.118  /* Call with no locks held and interrupts enabled (e.g., softirq context). */
   2.119  void new_tlbflush_clock_period(void)
   2.120  {
   2.121 -    ASSERT(local_irq_is_enabled());
   2.122 -    
   2.123 +    cpumask_t allbutself;
   2.124 +
   2.125      /* Flush everyone else. We definitely flushed just before entry. */
   2.126 -    if ( num_online_cpus() > 1 )
   2.127 -    {
   2.128 -        spin_lock(&flush_lock);
   2.129 -        flush_cpumask = cpu_online_map;
   2.130 -        flush_va      = FLUSHVA_ALL;
   2.131 -        send_IPI_allbutself(INVALIDATE_TLB_VECTOR);
   2.132 -        cpu_clear(smp_processor_id(), flush_cpumask);
   2.133 -        while ( !cpus_empty(flush_cpumask) )
   2.134 -            cpu_relax();
   2.135 -        spin_unlock(&flush_lock);
   2.136 -    }
   2.137 +    allbutself = cpu_online_map;
   2.138 +    cpu_clear(smp_processor_id(), allbutself);
   2.139 +    __flush_tlb_mask(allbutself, FLUSHVA_ALL);
   2.140  
   2.141      /* No need for atomicity: we are the only possible updater. */
   2.142      ASSERT(tlbflush_clock == 0);
     3.1 --- a/xen/include/asm-x86/genapic.h	Mon Apr 03 15:52:58 2006 +0100
     3.2 +++ b/xen/include/asm-x86/genapic.h	Mon Apr 03 16:35:06 2006 +0100
     3.3 @@ -54,8 +54,6 @@ struct genapic {
     3.4  	
     3.5  	/* ipi */
     3.6  	void (*send_IPI_mask)(cpumask_t mask, int vector);
     3.7 -	void (*send_IPI_allbutself)(int vector);
     3.8 -	void (*send_IPI_all)(int vector);
     3.9  }; 
    3.10  
    3.11  #define APICFUNC(x) .x = x
    3.12 @@ -85,8 +83,6 @@ struct genapic {
    3.13  	APICFUNC(cpu_mask_to_apicid), \
    3.14  	APICFUNC(acpi_madt_oem_check), \
    3.15  	APICFUNC(send_IPI_mask), \
    3.16 -	APICFUNC(send_IPI_allbutself), \
    3.17 -	APICFUNC(send_IPI_all), \
    3.18  	APICFUNC(enable_apic_mode), \
    3.19  	APICFUNC(phys_pkg_id), \
    3.20  	}
     4.1 --- a/xen/include/asm-x86/mach-bigsmp/mach_ipi.h	Mon Apr 03 15:52:58 2006 +0100
     4.2 +++ b/xen/include/asm-x86/mach-bigsmp/mach_ipi.h	Mon Apr 03 16:35:06 2006 +0100
     4.3 @@ -8,18 +8,4 @@ static inline void send_IPI_mask(cpumask
     4.4  	send_IPI_mask_sequence(mask, vector);
     4.5  }
     4.6  
     4.7 -static inline void send_IPI_allbutself(int vector)
     4.8 -{
     4.9 -	cpumask_t mask = cpu_online_map;
    4.10 -	cpu_clear(smp_processor_id(), mask);
    4.11 -
    4.12 -	if (!cpus_empty(mask))
    4.13 -		send_IPI_mask(mask, vector);
    4.14 -}
    4.15 -
    4.16 -static inline void send_IPI_all(int vector)
    4.17 -{
    4.18 -	send_IPI_mask(cpu_online_map, vector);
    4.19 -}
    4.20 -
    4.21  #endif /* __ASM_MACH_IPI_H */
     5.1 --- a/xen/include/asm-x86/mach-default/mach_ipi.h	Mon Apr 03 15:52:58 2006 +0100
     5.2 +++ b/xen/include/asm-x86/mach-default/mach_ipi.h	Mon Apr 03 16:35:06 2006 +0100
     5.3 @@ -2,50 +2,10 @@
     5.4  #define __ASM_MACH_IPI_H
     5.5  
     5.6  void send_IPI_mask_bitmask(cpumask_t mask, int vector);
     5.7 -void __send_IPI_shortcut(unsigned int shortcut, int vector);
     5.8 -
     5.9 -extern int no_broadcast;
    5.10  
    5.11  static inline void send_IPI_mask(cpumask_t mask, int vector)
    5.12  {
    5.13  	send_IPI_mask_bitmask(mask, vector);
    5.14  }
    5.15  
    5.16 -static inline void __local_send_IPI_allbutself(int vector)
    5.17 -{
    5.18 -	if (no_broadcast) {
    5.19 -		cpumask_t mask = cpu_online_map;
    5.20 -
    5.21 -		cpu_clear(smp_processor_id(), mask);
    5.22 -		send_IPI_mask(mask, vector);
    5.23 -	} else
    5.24 -		__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
    5.25 -}
    5.26 -
    5.27 -static inline void __local_send_IPI_all(int vector)
    5.28 -{
    5.29 -	if (no_broadcast)
    5.30 -		send_IPI_mask(cpu_online_map, vector);
    5.31 -	else
    5.32 -		__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
    5.33 -}
    5.34 -
    5.35 -static inline void send_IPI_allbutself(int vector)
    5.36 -{
    5.37 -	/*
    5.38 -	 * if there are no other CPUs in the system then we get an APIC send 
    5.39 -	 * error if we try to broadcast, thus avoid sending IPIs in this case.
    5.40 -	 */
    5.41 -	if (!(num_online_cpus() > 1))
    5.42 -		return;
    5.43 -
    5.44 -	__local_send_IPI_allbutself(vector);
    5.45 -	return;
    5.46 -}
    5.47 -
    5.48 -static inline void send_IPI_all(int vector)
    5.49 -{
    5.50 -	__local_send_IPI_all(vector);
    5.51 -}
    5.52 -
    5.53  #endif /* __ASM_MACH_IPI_H */
     6.1 --- a/xen/include/asm-x86/mach-es7000/mach_ipi.h	Mon Apr 03 15:52:58 2006 +0100
     6.2 +++ b/xen/include/asm-x86/mach-es7000/mach_ipi.h	Mon Apr 03 16:35:06 2006 +0100
     6.3 @@ -8,17 +8,4 @@ static inline void send_IPI_mask(cpumask
     6.4  	send_IPI_mask_sequence(mask, vector);
     6.5  }
     6.6  
     6.7 -static inline void send_IPI_allbutself(int vector)
     6.8 -{
     6.9 -	cpumask_t mask = cpu_online_map;
    6.10 -	cpu_clear(smp_processor_id(), mask);
    6.11 -	if (!cpus_empty(mask))
    6.12 -		send_IPI_mask(mask, vector);
    6.13 -}
    6.14 -
    6.15 -static inline void send_IPI_all(int vector)
    6.16 -{
    6.17 -	send_IPI_mask(cpu_online_map, vector);
    6.18 -}
    6.19 -
    6.20  #endif /* __ASM_MACH_IPI_H */
     7.1 --- a/xen/include/asm-x86/mach-generic/mach_ipi.h	Mon Apr 03 15:52:58 2006 +0100
     7.2 +++ b/xen/include/asm-x86/mach-generic/mach_ipi.h	Mon Apr 03 16:35:06 2006 +0100
     7.3 @@ -4,7 +4,5 @@
     7.4  #include <asm/genapic.h>
     7.5  
     7.6  #define send_IPI_mask (genapic->send_IPI_mask)
     7.7 -#define send_IPI_allbutself (genapic->send_IPI_allbutself)
     7.8 -#define send_IPI_all (genapic->send_IPI_all)
     7.9  
    7.10  #endif
     8.1 --- a/xen/include/asm-x86/mach-summit/mach_ipi.h	Mon Apr 03 15:52:58 2006 +0100
     8.2 +++ b/xen/include/asm-x86/mach-summit/mach_ipi.h	Mon Apr 03 16:35:06 2006 +0100
     8.3 @@ -8,18 +8,4 @@ static inline void send_IPI_mask(cpumask
     8.4  	send_IPI_mask_sequence(mask, vector);
     8.5  }
     8.6  
     8.7 -static inline void send_IPI_allbutself(int vector)
     8.8 -{
     8.9 -	cpumask_t mask = cpu_online_map;
    8.10 -	cpu_clear(smp_processor_id(), mask);
    8.11 -
    8.12 -	if (!cpus_empty(mask))
    8.13 -		send_IPI_mask(mask, vector);
    8.14 -}
    8.15 -
    8.16 -static inline void send_IPI_all(int vector)
    8.17 -{
    8.18 -	send_IPI_mask(cpu_online_map, vector);
    8.19 -}
    8.20 -
    8.21  #endif /* __ASM_MACH_IPI_H */