diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-03-08 09:23:27 +0000 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-03-08 09:23:27 +0000 |
commit | d4faf5a948c03ffe61b4bfd1ebcdc93343727ca4 (patch) | |
tree | fa8363186763e4dd9707edf3bdb9171bf3bd23d9 /xen/arch/x86/nmi.c | |
parent | 338db98dd8d2cf1a639951597880d7a2e7f3b3d6 (diff) | |
download | xen-d4faf5a948c03ffe61b4bfd1ebcdc93343727ca4.tar.gz xen-d4faf5a948c03ffe61b4bfd1ebcdc93343727ca4.tar.bz2 xen-d4faf5a948c03ffe61b4bfd1ebcdc93343727ca4.zip |
NMI: Command line parameter for watchdog timeout
Introduce a command parameter to set the watchtog timeout. Manually
specifying "watchdog_timeout=<seconds>" on the command line will also
turn the watchdog on. For consistency, move opt_watchdog into nmi.c
along with opt_watchdog_timeout.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/nmi.c')
-rw-r--r-- | xen/arch/x86/nmi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index 2fd864e868..4e2cd53b75 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -40,6 +40,19 @@ static unsigned int nmi_p4_cccr_val; static DEFINE_PER_CPU(struct timer, nmi_timer); static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks); +/* opt_watchdog: If true, run a watchdog NMI on each processor. */ +bool_t __initdata opt_watchdog = 0; +boolean_param("watchdog", opt_watchdog); + +/* opt_watchdog_timeout: Number of seconds to wait before panic. */ +static unsigned int opt_watchdog_timeout = 5; +static void parse_watchdog_timeout(char * s) +{ + opt_watchdog_timeout = simple_strtoull(s, NULL, 0); + opt_watchdog = !!opt_watchdog_timeout; +} +custom_param("watchdog_timeout", parse_watchdog_timeout); + /* * lapic_nmi_owner tracks the ownership of the lapic NMI hardware: * - it may be reserved by some other driver, or not @@ -425,11 +438,11 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs) !atomic_read(&watchdog_disable_count) ) { /* - * Ayiee, looks like this CPU is stuck ... wait a few IRQs (5 seconds) + * Ayiee, looks like this CPU is stuck ... wait for the timeout * before doing the oops ... */ this_cpu(alert_counter)++; - if ( this_cpu(alert_counter) == 5*nmi_hz ) + if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz ) { console_force_unlock(); printk("Watchdog timer detects that CPU%d is stuck!\n", |