Skip to content

Commit 072b198

Browse files
dzickusrhIngo Molnar
authored andcommitted
x86, nmi_watchdog: Remove all stub function calls from old nmi_watchdog
Now that the bulk of the old nmi_watchdog is gone, remove all the stub variables and hooks associated with it. This touches lots of files mainly because of how the io_apic nmi_watchdog was implemented. Now that the io_apic nmi_watchdog is forever gone, remove all its fingers. Most of this code was not being exercised by virtue of nmi_watchdog != NMI_IO_APIC, so there shouldn't be anything to risky here. Signed-off-by: Don Zickus <[email protected]> Cc: [email protected] Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5f2b0ba commit 072b198

File tree

15 files changed

+2
-819
lines changed

15 files changed

+2
-819
lines changed

arch/x86/include/asm/nmi.h

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,22 @@
77

88
#ifdef ARCH_HAS_NMI_WATCHDOG
99

10-
/**
11-
* do_nmi_callback
12-
*
13-
* Check to see if a callback exists and execute it. Return 1
14-
* if the handler exists and was handled successfully.
15-
*/
16-
int do_nmi_callback(struct pt_regs *regs, int cpu);
17-
1810
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
19-
extern int check_nmi_watchdog(void);
2011
extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
2112
extern int reserve_perfctr_nmi(unsigned int);
2213
extern void release_perfctr_nmi(unsigned int);
2314
extern int reserve_evntsel_nmi(unsigned int);
2415
extern void release_evntsel_nmi(unsigned int);
2516

26-
extern void setup_apic_nmi_watchdog(void *);
27-
extern void stop_apic_nmi_watchdog(void *);
28-
extern void disable_timer_nmi_watchdog(void);
29-
extern void enable_timer_nmi_watchdog(void);
30-
extern void cpu_nmi_set_wd_enabled(void);
31-
32-
extern atomic_t nmi_active;
33-
extern unsigned int nmi_watchdog;
34-
#define NMI_NONE 0
35-
#define NMI_IO_APIC 1
36-
#define NMI_LOCAL_APIC 2
37-
#define NMI_INVALID 3
38-
3917
struct ctl_table;
4018
extern int proc_nmi_enabled(struct ctl_table *, int ,
4119
void __user *, size_t *, loff_t *);
4220
extern int unknown_nmi_panic;
4321

4422
void arch_trigger_all_cpu_backtrace(void);
4523
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
46-
47-
static inline void localise_nmi_watchdog(void)
48-
{
49-
if (nmi_watchdog == NMI_IO_APIC)
50-
nmi_watchdog = NMI_LOCAL_APIC;
51-
}
52-
53-
/* check if nmi_watchdog is active (ie was specified at boot) */
54-
static inline int nmi_watchdog_active(void)
55-
{
56-
/*
57-
* actually it should be:
58-
* return (nmi_watchdog == NMI_LOCAL_APIC ||
59-
* nmi_watchdog == NMI_IO_APIC)
60-
* but since they are power of two we could use a
61-
* cheaper way --cvg
62-
*/
63-
return nmi_watchdog & (NMI_LOCAL_APIC | NMI_IO_APIC);
64-
}
6524
#endif
6625

67-
void lapic_watchdog_stop(void);
68-
int lapic_watchdog_init(unsigned nmi_hz);
69-
int lapic_wd_event(unsigned nmi_hz);
70-
unsigned lapic_adjust_nmi_hz(unsigned hz);
71-
void disable_lapic_nmi_watchdog(void);
72-
void enable_lapic_nmi_watchdog(void);
7326
void stop_nmi(void);
7427
void restart_nmi(void);
7528

arch/x86/include/asm/smpboot_hooks.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ static inline void __init smpboot_setup_io_apic(void)
4848
setup_IO_APIC();
4949
else {
5050
nr_ioapics = 0;
51-
localise_nmi_watchdog();
5251
}
5352
#endif
5453
}

arch/x86/include/asm/timer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
unsigned long long native_sched_clock(void);
1111
extern int recalibrate_cpu_khz(void);
1212

13-
#if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC)
14-
extern int timer_ack;
15-
#else
16-
# define timer_ack (0)
17-
#endif
18-
1913
extern int no_timer_check;
2014

2115
/* Accelerators for sched_clock()

arch/x86/kernel/apic/apic.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <linux/init.h>
3232
#include <linux/cpu.h>
3333
#include <linux/dmi.h>
34-
#include <linux/nmi.h>
3534
#include <linux/smp.h>
3635
#include <linux/mm.h>
3736

@@ -799,11 +798,7 @@ void __init setup_boot_APIC_clock(void)
799798
* PIT/HPET going. Otherwise register lapic as a dummy
800799
* device.
801800
*/
802-
if (nmi_watchdog != NMI_IO_APIC)
803-
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
804-
else
805-
pr_warning("APIC timer registered as dummy,"
806-
" due to nmi_watchdog=%d!\n", nmi_watchdog);
801+
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
807802

808803
/* Setup the lapic or request the broadcast */
809804
setup_APIC_timer();
@@ -1387,7 +1382,6 @@ void __cpuinit end_local_APIC_setup(void)
13871382
}
13881383
#endif
13891384

1390-
setup_apic_nmi_watchdog(NULL);
13911385
apic_pm_activate();
13921386
}
13931387

@@ -1750,17 +1744,10 @@ int __init APIC_init_uniprocessor(void)
17501744
setup_IO_APIC();
17511745
else {
17521746
nr_ioapics = 0;
1753-
localise_nmi_watchdog();
17541747
}
1755-
#else
1756-
localise_nmi_watchdog();
17571748
#endif
17581749

17591750
x86_init.timers.setup_percpu_clockev();
1760-
#ifdef CONFIG_X86_64
1761-
check_nmi_watchdog();
1762-
#endif
1763-
17641751
return 0;
17651752
}
17661753

arch/x86/kernel/apic/hw_nmi.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,4 @@ early_initcall(register_trigger_all_cpu_backtrace);
9494
#endif
9595

9696
/* STUB calls to mimic old nmi_watchdog behaviour */
97-
#if defined(CONFIG_X86_LOCAL_APIC)
98-
unsigned int nmi_watchdog = NMI_NONE;
99-
EXPORT_SYMBOL(nmi_watchdog);
100-
#endif
101-
atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */
102-
EXPORT_SYMBOL(nmi_active);
10397
int unknown_nmi_panic;
104-
void cpu_nmi_set_wd_enabled(void) { return; }
105-
void stop_apic_nmi_watchdog(void *unused) { return; }
106-
void setup_apic_nmi_watchdog(void *unused) { return; }
107-
int __init check_nmi_watchdog(void) { return 0; }

arch/x86/kernel/apic/io_apic.c

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#include <asm/dma.h>
5555
#include <asm/timer.h>
5656
#include <asm/i8259.h>
57-
#include <asm/nmi.h>
5857
#include <asm/msidef.h>
5958
#include <asm/hypertransport.h>
6059
#include <asm/setup.h>
@@ -2643,24 +2642,6 @@ static void lapic_register_intr(int irq)
26432642
"edge");
26442643
}
26452644

2646-
static void __init setup_nmi(void)
2647-
{
2648-
/*
2649-
* Dirty trick to enable the NMI watchdog ...
2650-
* We put the 8259A master into AEOI mode and
2651-
* unmask on all local APICs LVT0 as NMI.
2652-
*
2653-
* The idea to use the 8259A in AEOI mode ('8259A Virtual Wire')
2654-
* is from Maciej W. Rozycki - so we do not have to EOI from
2655-
* the NMI handler or the timer interrupt.
2656-
*/
2657-
apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
2658-
2659-
enable_NMI_through_LVT0();
2660-
2661-
apic_printk(APIC_VERBOSE, " done.\n");
2662-
}
2663-
26642645
/*
26652646
* This looks a bit hackish but it's about the only one way of sending
26662647
* a few INTA cycles to 8259As and any associated glue logic. ICR does
@@ -2766,15 +2747,6 @@ static inline void __init check_timer(void)
27662747
*/
27672748
apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
27682749
legacy_pic->init(1);
2769-
#ifdef CONFIG_X86_32
2770-
{
2771-
unsigned int ver;
2772-
2773-
ver = apic_read(APIC_LVR);
2774-
ver = GET_APIC_VERSION(ver);
2775-
timer_ack = (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
2776-
}
2777-
#endif
27782750

27792751
pin1 = find_isa_irq_pin(0, mp_INT);
27802752
apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2822,10 +2794,6 @@ static inline void __init check_timer(void)
28222794
unmask_ioapic(cfg);
28232795
}
28242796
if (timer_irq_works()) {
2825-
if (nmi_watchdog == NMI_IO_APIC) {
2826-
setup_nmi();
2827-
legacy_pic->unmask(0);
2828-
}
28292797
if (disable_timer_pin_1 > 0)
28302798
clear_IO_APIC_pin(0, pin1);
28312799
goto out;
@@ -2851,11 +2819,6 @@ static inline void __init check_timer(void)
28512819
if (timer_irq_works()) {
28522820
apic_printk(APIC_QUIET, KERN_INFO "....... works.\n");
28532821
timer_through_8259 = 1;
2854-
if (nmi_watchdog == NMI_IO_APIC) {
2855-
legacy_pic->mask(0);
2856-
setup_nmi();
2857-
legacy_pic->unmask(0);
2858-
}
28592822
goto out;
28602823
}
28612824
/*
@@ -2867,15 +2830,6 @@ static inline void __init check_timer(void)
28672830
apic_printk(APIC_QUIET, KERN_INFO "....... failed.\n");
28682831
}
28692832

2870-
if (nmi_watchdog == NMI_IO_APIC) {
2871-
apic_printk(APIC_QUIET, KERN_WARNING "timer doesn't work "
2872-
"through the IO-APIC - disabling NMI Watchdog!\n");
2873-
nmi_watchdog = NMI_NONE;
2874-
}
2875-
#ifdef CONFIG_X86_32
2876-
timer_ack = 0;
2877-
#endif
2878-
28792833
apic_printk(APIC_QUIET, KERN_INFO
28802834
"...trying to set up timer as Virtual Wire IRQ...\n");
28812835

arch/x86/kernel/cpu/perf_event.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ static bool reserve_pmc_hardware(void)
330330
{
331331
int i;
332332

333-
if (nmi_watchdog == NMI_LOCAL_APIC)
334-
disable_lapic_nmi_watchdog();
335-
336333
for (i = 0; i < x86_pmu.num_counters; i++) {
337334
if (!reserve_perfctr_nmi(x86_pmu.perfctr + i))
338335
goto perfctr_fail;
@@ -355,9 +352,6 @@ static bool reserve_pmc_hardware(void)
355352
for (i--; i >= 0; i--)
356353
release_perfctr_nmi(x86_pmu.perfctr + i);
357354

358-
if (nmi_watchdog == NMI_LOCAL_APIC)
359-
enable_lapic_nmi_watchdog();
360-
361355
return false;
362356
}
363357

@@ -369,9 +363,6 @@ static void release_pmc_hardware(void)
369363
release_perfctr_nmi(x86_pmu.perfctr + i);
370364
release_evntsel_nmi(x86_pmu.eventsel + i);
371365
}
372-
373-
if (nmi_watchdog == NMI_LOCAL_APIC)
374-
enable_lapic_nmi_watchdog();
375366
}
376367

377368
#else

0 commit comments

Comments
 (0)