[Devel] [PATCH RHEL7 COMMIT] Revert "x86/NMI: introduce dumps via nmi"

Konstantin Khorenko khorenko at virtuozzo.com
Thu Jun 18 09:09:43 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.15
------>
commit b37a5c56f921ac6f4dbd27597bbedae334295506
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Thu Jun 18 20:09:43 2015 +0400

    Revert "x86/NMI: introduce dumps via nmi"
    
    This reverts commit d0f4641de70c7417cf2822221dbc845d8671540c.
    
    This is used to dump registers from all CPUs by sending them IPIs. This
    is called automatically on a BUG or manually by hitting sysrq-p. In
    either case it is useless, because BUG results in a vmcore, which
    contains full registers dump, while sysrq-p is rarely used since the
    NMI it is supposed to send on PCS6 can lead to our hypervisor crash.
    Instead we use sysrq-w for debugging instead.
    
    https://jira.sw.ru/browse/PSBM-17989
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 arch/x86/kernel/dumpstack.c |  1 -
 arch/x86/kernel/smp.c       |  5 ----
 include/linux/nmi.h         |  3 +--
 kernel/printk.c             | 62 ---------------------------------------------
 4 files changed, 1 insertion(+), 70 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 6ae29cf..deb6421 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -267,7 +267,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
 
 	print_modules();
 	show_regs(regs);
-	nmi_show_regs(regs, 1);
 #ifdef CONFIG_X86_32
 	if (user_mode_vm(regs)) {
 		sp = regs->sp;
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index bb0785b..cdaa347 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -333,11 +333,6 @@ void smp_trace_call_function_single_interrupt(struct pt_regs *regs)
 	exiting_irq();
 }
 
-void send_nmi_ipi_allbutself(void)
-{
-	apic->send_IPI_allbutself(NMI_VECTOR);
-}
-
 static int __init nonmi_ipi_setup(char *str)
 {
 	smp_no_nmi_ipi = true;
diff --git a/include/linux/nmi.h b/include/linux/nmi.h
index 3b4ff0c..6a45fb5 100644
--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -52,6 +52,5 @@ struct ctl_table;
 extern int proc_dowatchdog(struct ctl_table *, int ,
 			   void __user *, size_t *, loff_t *);
 #endif
-extern void nmi_show_regs(struct pt_regs *regs, int in_nmi);
-extern int do_nmi_show_regs(struct pt_regs *regs, int cpu);
+
 #endif
diff --git a/kernel/printk.c b/kernel/printk.c
index afb7cf8..5488a59 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -3127,65 +3127,3 @@ void show_regs_print_info(const char *log_lvl)
 }
 
 #endif
-
-static cpumask_t nmi_show_regs_cpus = CPU_MASK_NONE;
-static unsigned long nmi_show_regs_timeout;
-
-void __attribute__((weak)) send_nmi_ipi_allbutself(void)
-{
-	cpus_clear(nmi_show_regs_cpus);
-}
-
-static void busted_show_regs(struct pt_regs *regs, int in_nmi)
-{
-	if (!regs || (in_nmi && raw_spin_is_locked(&logbuf_lock)))
-		return;
-
-	bust_spinlocks(1);
-	printk("----------- IPI show regs -----------\n");
-	show_regs(regs);
-	bust_spinlocks(0);
-}
-
-void nmi_show_regs(struct pt_regs *regs, int in_nmi)
-{
-	if (cpus_empty(nmi_show_regs_cpus))
-		goto doit;
-
-	/* Previous request still in progress */
-	if (time_before(jiffies, nmi_show_regs_timeout))
-		return;
-
-	if (!in_nmi || !raw_spin_is_locked(&logbuf_lock)) {
-		int cpu;
-
-		bust_spinlocks(1);
-		printk("previous show regs lost IPI to: ");
-		for_each_cpu_mask(cpu, nmi_show_regs_cpus)
-			printk("%d ", cpu);
-		printk("\n");
-		bust_spinlocks(0);
-	}
-
-doit:
-	nmi_show_regs_timeout = jiffies + HZ/10;
-	nmi_show_regs_cpus = *(cpumask_t *)cpu_online_mask;
-	cpu_clear(raw_smp_processor_id(), nmi_show_regs_cpus);
-	busted_show_regs(regs, in_nmi);
-	send_nmi_ipi_allbutself();
-}
-
-/* call only from nmi handler */
-int do_nmi_show_regs(struct pt_regs *regs, int cpu)
-{
-	static DEFINE_SPINLOCK(nmi_show_regs_lock);
-
-	if (!cpu_isset(cpu, nmi_show_regs_cpus))
-		return 0;
-
-	spin_lock(&nmi_show_regs_lock);
-	busted_show_regs(regs, 1);
-	cpu_clear(cpu, nmi_show_regs_cpus);
-	spin_unlock(&nmi_show_regs_lock);
-	return 1;
-}



More information about the Devel mailing list