WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86 nmi: Enable/disable dynamically on ea

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86 nmi: Enable/disable dynamically on each CPU during hotplug.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 May 2010 05:16:18 -0700
Delivery-date: Wed, 19 May 2010 05:22:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1274265548 -3600
# Node ID a6f24be72f667b2a339b6412dcebe72d94d757a9
# Parent  abc9f8e809e555b00d16a94fa4a1635803591fc9
x86 nmi: Enable/disable dynamically on each CPU during hotplug.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/nmi.c |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff -r abc9f8e809e5 -r a6f24be72f66 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c        Wed May 19 11:15:26 2010 +0100
+++ b/xen/arch/x86/nmi.c        Wed May 19 11:39:08 2010 +0100
@@ -24,6 +24,7 @@
 #include <xen/console.h>
 #include <xen/smp.h>
 #include <xen/keyhandler.h>
+#include <xen/cpu.h>
 #include <asm/current.h>
 #include <asm/mc146818rtc.h>
 #include <asm/msr.h>
@@ -353,6 +354,32 @@ void __pminit setup_apic_nmi_watchdog(vo
     nmi_active = 1;
 }
 
+static int cpu_nmi_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        init_timer(&per_cpu(nmi_timer, cpu), nmi_timer_fn, NULL, cpu);
+        set_timer(&per_cpu(nmi_timer, cpu), NOW());
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        kill_timer(&per_cpu(nmi_timer, cpu));
+        break;
+    default:
+        break;
+    }
+
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nmi_nfb = {
+    .notifier_call = cpu_nmi_callback
+};
+
 static DEFINE_PER_CPU(unsigned int, last_irq_sums);
 static DEFINE_PER_CPU(unsigned int, alert_counter);
 
@@ -377,10 +404,8 @@ void watchdog_enable(void)
      * setup because the timer infrastructure is not available.
      */
     for_each_online_cpu ( cpu )
-    {
-        init_timer(&per_cpu(nmi_timer, cpu), nmi_timer_fn, NULL, cpu);
-        set_timer(&per_cpu(nmi_timer, cpu), NOW());
-    }
+        cpu_nmi_callback(&cpu_nmi_nfb, CPU_UP_PREPARE, (void *)(long)cpu);
+    register_cpu_notifier(&cpu_nmi_nfb);
 }
 
 void nmi_watchdog_tick(struct cpu_user_regs * regs)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86 nmi: Enable/disable dynamically on each CPU during hotplug., Xen patchbot-unstable <=