aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2018-12-04 22:38:25 -0500
committerDaniel Thompson <daniel.thompson@linaro.org>2018-12-30 03:24:21 -0500
commit9ef7fa507d6b53a96de4da3298c5f01bde603c0a (patch)
treea6cbedd8fa312d94ce8d8fcb96a19e5bf4fe981d
parent2595646791c319cadfdbf271563aac97d0843dc7 (diff)
kgdb: Remove irq flags from roundup
The function kgdb_roundup_cpus() was passed a parameter that was documented as: > the flags that will be used when restoring the interrupts. There is > local_irq_save() call before kgdb_roundup_cpus(). Nobody used those flags. Anyone who wanted to temporarily turn on interrupts just did local_irq_enable() and local_irq_disable() without looking at them. So we can definitely remove the flags. Signed-off-by: Douglas Anderson <dianders@chromium.org> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: James Hogan <jhogan@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Rich Felker <dalias@libc.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
-rw-r--r--arch/arc/kernel/kgdb.c2
-rw-r--r--arch/arm/kernel/kgdb.c2
-rw-r--r--arch/arm64/kernel/kgdb.c2
-rw-r--r--arch/hexagon/kernel/kgdb.c9
-rw-r--r--arch/mips/kernel/kgdb.c2
-rw-r--r--arch/powerpc/kernel/kgdb.c2
-rw-r--r--arch/sh/kernel/kgdb.c2
-rw-r--r--arch/sparc/kernel/smp_64.c2
-rw-r--r--arch/x86/kernel/kgdb.c9
-rw-r--r--include/linux/kgdb.h9
-rw-r--r--kernel/debug/debug_core.c2
11 files changed, 14 insertions, 29 deletions
diff --git a/arch/arc/kernel/kgdb.c b/arch/arc/kernel/kgdb.c
index 9a3c34af2ae8..0932851028e0 100644
--- a/arch/arc/kernel/kgdb.c
+++ b/arch/arc/kernel/kgdb.c
@@ -197,7 +197,7 @@ static void kgdb_call_nmi_hook(void *ignored)
197 kgdb_nmicallback(raw_smp_processor_id(), NULL); 197 kgdb_nmicallback(raw_smp_processor_id(), NULL);
198} 198}
199 199
200void kgdb_roundup_cpus(unsigned long flags) 200void kgdb_roundup_cpus(void)
201{ 201{
202 local_irq_enable(); 202 local_irq_enable();
203 smp_call_function(kgdb_call_nmi_hook, NULL, 0); 203 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
index caa0dbe3dc61..f21077b077be 100644
--- a/arch/arm/kernel/kgdb.c
+++ b/arch/arm/kernel/kgdb.c
@@ -175,7 +175,7 @@ static void kgdb_call_nmi_hook(void *ignored)
175 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); 175 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
176} 176}
177 177
178void kgdb_roundup_cpus(unsigned long flags) 178void kgdb_roundup_cpus(void)
179{ 179{
180 local_irq_enable(); 180 local_irq_enable();
181 smp_call_function(kgdb_call_nmi_hook, NULL, 0); 181 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c
index a20de58061a8..12c339ff6e75 100644
--- a/arch/arm64/kernel/kgdb.c
+++ b/arch/arm64/kernel/kgdb.c
@@ -289,7 +289,7 @@ static void kgdb_call_nmi_hook(void *ignored)
289 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); 289 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
290} 290}
291 291
292void kgdb_roundup_cpus(unsigned long flags) 292void kgdb_roundup_cpus(void)
293{ 293{
294 local_irq_enable(); 294 local_irq_enable();
295 smp_call_function(kgdb_call_nmi_hook, NULL, 0); 295 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
diff --git a/arch/hexagon/kernel/kgdb.c b/arch/hexagon/kernel/kgdb.c
index 16c24b22d0b2..012e0e230ac2 100644
--- a/arch/hexagon/kernel/kgdb.c
+++ b/arch/hexagon/kernel/kgdb.c
@@ -119,17 +119,12 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc)
119 119
120/** 120/**
121 * kgdb_roundup_cpus - Get other CPUs into a holding pattern 121 * kgdb_roundup_cpus - Get other CPUs into a holding pattern
122 * @flags: Current IRQ state
123 * 122 *
124 * On SMP systems, we need to get the attention of the other CPUs 123 * On SMP systems, we need to get the attention of the other CPUs
125 * and get them be in a known state. This should do what is needed 124 * and get them be in a known state. This should do what is needed
126 * to get the other CPUs to call kgdb_wait(). Note that on some arches, 125 * to get the other CPUs to call kgdb_wait(). Note that on some arches,
127 * the NMI approach is not used for rounding up all the CPUs. For example, 126 * the NMI approach is not used for rounding up all the CPUs. For example,
128 * in case of MIPS, smp_call_function() is used to roundup CPUs. In 127 * in case of MIPS, smp_call_function() is used to roundup CPUs.
129 * this case, we have to make sure that interrupts are enabled before
130 * calling smp_call_function(). The argument to this function is
131 * the flags that will be used when restoring the interrupts. There is
132 * local_irq_save() call before kgdb_roundup_cpus().
133 * 128 *
134 * On non-SMP systems, this is not called. 129 * On non-SMP systems, this is not called.
135 */ 130 */
@@ -139,7 +134,7 @@ static void hexagon_kgdb_nmi_hook(void *ignored)
139 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); 134 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
140} 135}
141 136
142void kgdb_roundup_cpus(unsigned long flags) 137void kgdb_roundup_cpus(void)
143{ 138{
144 local_irq_enable(); 139 local_irq_enable();
145 smp_call_function(hexagon_kgdb_nmi_hook, NULL, 0); 140 smp_call_function(hexagon_kgdb_nmi_hook, NULL, 0);
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index eb6c0d582626..2b05effc17b4 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -219,7 +219,7 @@ static void kgdb_call_nmi_hook(void *ignored)
219 set_fs(old_fs); 219 set_fs(old_fs);
220} 220}
221 221
222void kgdb_roundup_cpus(unsigned long flags) 222void kgdb_roundup_cpus(void)
223{ 223{
224 local_irq_enable(); 224 local_irq_enable();
225 smp_call_function(kgdb_call_nmi_hook, NULL, 0); 225 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 59c578f865aa..b0e804844be0 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -124,7 +124,7 @@ static int kgdb_call_nmi_hook(struct pt_regs *regs)
124} 124}
125 125
126#ifdef CONFIG_SMP 126#ifdef CONFIG_SMP
127void kgdb_roundup_cpus(unsigned long flags) 127void kgdb_roundup_cpus(void)
128{ 128{
129 smp_send_debugger_break(); 129 smp_send_debugger_break();
130} 130}
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c
index 4f04c6638a4d..cc57630f6bf2 100644
--- a/arch/sh/kernel/kgdb.c
+++ b/arch/sh/kernel/kgdb.c
@@ -319,7 +319,7 @@ static void kgdb_call_nmi_hook(void *ignored)
319 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); 319 kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
320} 320}
321 321
322void kgdb_roundup_cpus(unsigned long flags) 322void kgdb_roundup_cpus(void)
323{ 323{
324 local_irq_enable(); 324 local_irq_enable();
325 smp_call_function(kgdb_call_nmi_hook, NULL, 0); 325 smp_call_function(kgdb_call_nmi_hook, NULL, 0);
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 4792e08ad36b..f45d876983f1 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1014,7 +1014,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
1014} 1014}
1015 1015
1016#ifdef CONFIG_KGDB 1016#ifdef CONFIG_KGDB
1017void kgdb_roundup_cpus(unsigned long flags) 1017void kgdb_roundup_cpus(void)
1018{ 1018{
1019 smp_cross_call(&xcall_kgdb_capture, 0, 0, 0); 1019 smp_cross_call(&xcall_kgdb_capture, 0, 0, 0);
1020} 1020}
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 8e36f249646e..ac6291a4178d 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -422,21 +422,16 @@ static void kgdb_disable_hw_debug(struct pt_regs *regs)
422#ifdef CONFIG_SMP 422#ifdef CONFIG_SMP
423/** 423/**
424 * kgdb_roundup_cpus - Get other CPUs into a holding pattern 424 * kgdb_roundup_cpus - Get other CPUs into a holding pattern
425 * @flags: Current IRQ state
426 * 425 *
427 * On SMP systems, we need to get the attention of the other CPUs 426 * On SMP systems, we need to get the attention of the other CPUs
428 * and get them be in a known state. This should do what is needed 427 * and get them be in a known state. This should do what is needed
429 * to get the other CPUs to call kgdb_wait(). Note that on some arches, 428 * to get the other CPUs to call kgdb_wait(). Note that on some arches,
430 * the NMI approach is not used for rounding up all the CPUs. For example, 429 * the NMI approach is not used for rounding up all the CPUs. For example,
431 * in case of MIPS, smp_call_function() is used to roundup CPUs. In 430 * in case of MIPS, smp_call_function() is used to roundup CPUs.
432 * this case, we have to make sure that interrupts are enabled before
433 * calling smp_call_function(). The argument to this function is
434 * the flags that will be used when restoring the interrupts. There is
435 * local_irq_save() call before kgdb_roundup_cpus().
436 * 431 *
437 * On non-SMP systems, this is not called. 432 * On non-SMP systems, this is not called.
438 */ 433 */
439void kgdb_roundup_cpus(unsigned long flags) 434void kgdb_roundup_cpus(void)
440{ 435{
441 apic->send_IPI_allbutself(APIC_DM_NMI); 436 apic->send_IPI_allbutself(APIC_DM_NMI);
442} 437}
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index e465bb15912d..05e5b2eb0d32 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -178,21 +178,16 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code,
178 178
179/** 179/**
180 * kgdb_roundup_cpus - Get other CPUs into a holding pattern 180 * kgdb_roundup_cpus - Get other CPUs into a holding pattern
181 * @flags: Current IRQ state
182 * 181 *
183 * On SMP systems, we need to get the attention of the other CPUs 182 * On SMP systems, we need to get the attention of the other CPUs
184 * and get them into a known state. This should do what is needed 183 * and get them into a known state. This should do what is needed
185 * to get the other CPUs to call kgdb_wait(). Note that on some arches, 184 * to get the other CPUs to call kgdb_wait(). Note that on some arches,
186 * the NMI approach is not used for rounding up all the CPUs. For example, 185 * the NMI approach is not used for rounding up all the CPUs. For example,
187 * in case of MIPS, smp_call_function() is used to roundup CPUs. In 186 * in case of MIPS, smp_call_function() is used to roundup CPUs.
188 * this case, we have to make sure that interrupts are enabled before
189 * calling smp_call_function(). The argument to this function is
190 * the flags that will be used when restoring the interrupts. There is
191 * local_irq_save() call before kgdb_roundup_cpus().
192 * 187 *
193 * On non-SMP systems, this is not called. 188 * On non-SMP systems, this is not called.
194 */ 189 */
195extern void kgdb_roundup_cpus(unsigned long flags); 190extern void kgdb_roundup_cpus(void);
196 191
197/** 192/**
198 * kgdb_arch_set_pc - Generic call back to the program counter 193 * kgdb_arch_set_pc - Generic call back to the program counter
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 65c0f1363788..f3cadda45f07 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -593,7 +593,7 @@ return_normal:
593 593
594 /* Signal the other CPUs to enter kgdb_wait() */ 594 /* Signal the other CPUs to enter kgdb_wait() */
595 else if ((!kgdb_single_step) && kgdb_do_roundup) 595 else if ((!kgdb_single_step) && kgdb_do_roundup)
596 kgdb_roundup_cpus(flags); 596 kgdb_roundup_cpus();
597#endif 597#endif
598 598
599 /* 599 /*