diff options
author | Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp> | 2007-05-09 05:33:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:48 -0400 |
commit | 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f (patch) | |
tree | b66a624ba68766282fa0ddb509ff641552703da4 /include | |
parent | dd2a345f8f002845636dbf5d2d768bb5cd8a5f59 (diff) |
Remove hardcoding of hard_smp_processor_id on UP systems
With the advent of kdump, the assumption that the boot CPU when booting an UP
kernel is always the CPU with a particular hardware ID (often 0) (usually
referred to as BSP on some architectures) is not valid anymore. The reason
being that the dump capture kernel boots on the crashed CPU (the CPU that
invoked crash_kexec), which may be or may not be that particular CPU.
Move definition of hard_smp_processor_id for the UP case to
architecture-specific code ("asm/smp.h") where it belongs, so that each
architecture can provide its own implementation.
Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Acked-by: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/smp.h | 1 | ||||
-rw-r--r-- | include/asm-i386/smp.h | 3 | ||||
-rw-r--r-- | include/asm-ia64/smp.h | 3 | ||||
-rw-r--r-- | include/asm-m32r/smp.h | 6 | ||||
-rw-r--r-- | include/asm-powerpc/smp.h | 1 | ||||
-rw-r--r-- | include/asm-s390/smp.h | 1 | ||||
-rw-r--r-- | include/asm-sparc/smp.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/smp.h | 1 | ||||
-rw-r--r-- | include/asm-um/smp.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/smp.h | 4 | ||||
-rw-r--r-- | include/linux/smp.h | 1 |
11 files changed, 21 insertions, 5 deletions
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h index a1a1eca6be45..286e1d844f63 100644 --- a/include/asm-alpha/smp.h +++ b/include/asm-alpha/smp.h | |||
@@ -51,6 +51,7 @@ int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, in | |||
51 | 51 | ||
52 | #else /* CONFIG_SMP */ | 52 | #else /* CONFIG_SMP */ |
53 | 53 | ||
54 | #define hard_smp_processor_id() 0 | ||
54 | #define smp_call_function_on_cpu(func,info,retry,wait,cpu) ({ 0; }) | 55 | #define smp_call_function_on_cpu(func,info,retry,wait,cpu) ({ 0; }) |
55 | 56 | ||
56 | #endif /* CONFIG_SMP */ | 57 | #endif /* CONFIG_SMP */ |
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 090abc1da32a..3243fa6f455f 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h | |||
@@ -147,12 +147,13 @@ extern unsigned int num_processors; | |||
147 | 147 | ||
148 | #else /* CONFIG_SMP */ | 148 | #else /* CONFIG_SMP */ |
149 | 149 | ||
150 | #define hard_smp_processor_id() 0 | ||
150 | #define safe_smp_processor_id() 0 | 151 | #define safe_smp_processor_id() 0 |
151 | #define cpu_physical_id(cpu) boot_cpu_physical_apicid | 152 | #define cpu_physical_id(cpu) boot_cpu_physical_apicid |
152 | 153 | ||
153 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 154 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
154 | 155 | ||
155 | #endif | 156 | #endif /* CONFIG_SMP */ |
156 | 157 | ||
157 | #ifndef __ASSEMBLY__ | 158 | #ifndef __ASSEMBLY__ |
158 | 159 | ||
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index 60fd4ae014f6..62014b643ecd 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
@@ -128,8 +128,9 @@ extern void unlock_ipi_calllock(void); | |||
128 | extern void identify_siblings (struct cpuinfo_ia64 *); | 128 | extern void identify_siblings (struct cpuinfo_ia64 *); |
129 | extern int is_multithreading_enabled(void); | 129 | extern int is_multithreading_enabled(void); |
130 | 130 | ||
131 | #else | 131 | #else /* CONFIG_SMP */ |
132 | 132 | ||
133 | #define hard_smp_processor_id() 0 | ||
133 | #define cpu_logical_id(i) 0 | 134 | #define cpu_logical_id(i) 0 |
134 | #define cpu_physical_id(i) ia64_get_lid() | 135 | #define cpu_physical_id(i) ia64_get_lid() |
135 | 136 | ||
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index abd937ac5239..078e1a51a042 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -108,6 +108,10 @@ extern unsigned long send_IPI_mask_phys(cpumask_t, int, int); | |||
108 | #define IPI_SHIFT (0) | 108 | #define IPI_SHIFT (0) |
109 | #define NR_IPIS (8) | 109 | #define NR_IPIS (8) |
110 | 110 | ||
111 | #endif /* CONFIG_SMP */ | 111 | #else /* CONFIG_SMP */ |
112 | |||
113 | #define hard_smp_processor_id() 0 | ||
114 | |||
115 | #endif /* CONFIG_SMP */ | ||
112 | 116 | ||
113 | #endif /* _ASM_M32R_SMP_H */ | 117 | #endif /* _ASM_M32R_SMP_H */ |
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h index 01717f266dc9..d037f50580e2 100644 --- a/include/asm-powerpc/smp.h +++ b/include/asm-powerpc/smp.h | |||
@@ -83,6 +83,7 @@ extern void __cpu_die(unsigned int cpu); | |||
83 | 83 | ||
84 | #else | 84 | #else |
85 | /* for UP */ | 85 | /* for UP */ |
86 | #define hard_smp_processor_id() 0 | ||
86 | #define smp_setup_cpu_maps() | 87 | #define smp_setup_cpu_maps() |
87 | 88 | ||
88 | #endif /* CONFIG_SMP */ | 89 | #endif /* CONFIG_SMP */ |
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 0a28e6d6ef40..76e424f718c6 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h | |||
@@ -110,6 +110,7 @@ static inline void smp_send_stop(void) | |||
110 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); | 110 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); |
111 | } | 111 | } |
112 | 112 | ||
113 | #define hard_smp_processor_id() 0 | ||
113 | #define smp_cpu_not_running(cpu) 1 | 114 | #define smp_cpu_not_running(cpu) 1 |
114 | #define smp_setup_cpu_possible_map() do { } while (0) | 115 | #define smp_setup_cpu_possible_map() do { } while (0) |
115 | #endif | 116 | #endif |
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index b9da9a600e35..b3f492208fd2 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h | |||
@@ -165,6 +165,7 @@ void smp_setup_cpu_possible_map(void); | |||
165 | 165 | ||
166 | #else /* SMP */ | 166 | #else /* SMP */ |
167 | 167 | ||
168 | #define hard_smp_processor_id() 0 | ||
168 | #define smp_setup_cpu_possible_map() do { } while (0) | 169 | #define smp_setup_cpu_possible_map() do { } while (0) |
169 | 170 | ||
170 | #endif /* !(SMP) */ | 171 | #endif /* !(SMP) */ |
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h index cca54804b722..869d16fb907b 100644 --- a/include/asm-sparc64/smp.h +++ b/include/asm-sparc64/smp.h | |||
@@ -48,6 +48,7 @@ extern unsigned char boot_cpu_id; | |||
48 | 48 | ||
49 | #else | 49 | #else |
50 | 50 | ||
51 | #define hard_smp_processor_id() 0 | ||
51 | #define smp_setup_cpu_possible_map() do { } while (0) | 52 | #define smp_setup_cpu_possible_map() do { } while (0) |
52 | #define boot_cpu_id (0) | 53 | #define boot_cpu_id (0) |
53 | 54 | ||
diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h index ca552261ed1f..84f8cf29324e 100644 --- a/include/asm-um/smp.h +++ b/include/asm-um/smp.h | |||
@@ -24,6 +24,10 @@ extern inline void smp_cpus_done(unsigned int maxcpus) | |||
24 | 24 | ||
25 | extern struct task_struct *idle_threads[NR_CPUS]; | 25 | extern struct task_struct *idle_threads[NR_CPUS]; |
26 | 26 | ||
27 | #else | ||
28 | |||
29 | #define hard_smp_processor_id() 0 | ||
30 | |||
27 | #endif | 31 | #endif |
28 | 32 | ||
29 | #endif | 33 | #endif |
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index d5704421456b..f62fda527439 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -71,7 +71,9 @@ extern unsigned __cpuinitdata disabled_cpus; | |||
71 | 71 | ||
72 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 72 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
73 | 73 | ||
74 | #endif | 74 | #else /* CONFIG_SMP */ |
75 | #define hard_smp_processor_id() 0 | ||
76 | #endif /* CONFIG_SMP */ | ||
75 | 77 | ||
76 | /* | 78 | /* |
77 | * Some lowlevel functions might want to know about | 79 | * Some lowlevel functions might want to know about |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 7ba23ec8211b..3f70149eabbb 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -83,7 +83,6 @@ void smp_prepare_boot_cpu(void); | |||
83 | * These macros fold the SMP functionality into a single CPU system | 83 | * These macros fold the SMP functionality into a single CPU system |
84 | */ | 84 | */ |
85 | #define raw_smp_processor_id() 0 | 85 | #define raw_smp_processor_id() 0 |
86 | #define hard_smp_processor_id() 0 | ||
87 | static inline int up_smp_call_function(void) | 86 | static inline int up_smp_call_function(void) |
88 | { | 87 | { |
89 | return 0; | 88 | return 0; |