Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 072b198a authored by Don Zickus's avatar Don Zickus Committed by Ingo Molnar
Browse files

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: default avatarDon Zickus <dzickus@redhat.com>
Cc: fweisbec@gmail.com
Cc: gorcunov@openvz.org
LKML-Reference: <1289578944-28564-3-git-send-email-dzickus@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5f2b0ba4
Loading
Loading
Loading
Loading
+0 −47
Original line number Original line Diff line number Diff line
@@ -7,35 +7,13 @@


#ifdef ARCH_HAS_NMI_WATCHDOG
#ifdef ARCH_HAS_NMI_WATCHDOG


/**
 * do_nmi_callback
 *
 * Check to see if a callback exists and execute it.  Return 1
 * if the handler exists and was handled successfully.
 */
int do_nmi_callback(struct pt_regs *regs, int cpu);

extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
extern int check_nmi_watchdog(void);
extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
extern int reserve_perfctr_nmi(unsigned int);
extern int reserve_perfctr_nmi(unsigned int);
extern void release_perfctr_nmi(unsigned int);
extern void release_perfctr_nmi(unsigned int);
extern int reserve_evntsel_nmi(unsigned int);
extern int reserve_evntsel_nmi(unsigned int);
extern void release_evntsel_nmi(unsigned int);
extern void release_evntsel_nmi(unsigned int);


extern void setup_apic_nmi_watchdog(void *);
extern void stop_apic_nmi_watchdog(void *);
extern void disable_timer_nmi_watchdog(void);
extern void enable_timer_nmi_watchdog(void);
extern void cpu_nmi_set_wd_enabled(void);

extern atomic_t nmi_active;
extern unsigned int nmi_watchdog;
#define NMI_NONE	0
#define NMI_IO_APIC	1
#define NMI_LOCAL_APIC	2
#define NMI_INVALID	3

struct ctl_table;
struct ctl_table;
extern int proc_nmi_enabled(struct ctl_table *, int ,
extern int proc_nmi_enabled(struct ctl_table *, int ,
			void __user *, size_t *, loff_t *);
			void __user *, size_t *, loff_t *);
@@ -43,33 +21,8 @@ extern int unknown_nmi_panic;


void arch_trigger_all_cpu_backtrace(void);
void arch_trigger_all_cpu_backtrace(void);
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace
#define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace

static inline void localise_nmi_watchdog(void)
{
	if (nmi_watchdog == NMI_IO_APIC)
		nmi_watchdog = NMI_LOCAL_APIC;
}

/* check if nmi_watchdog is active (ie was specified at boot) */
static inline int nmi_watchdog_active(void)
{
	/*
	 * actually it should be:
	 * 	return (nmi_watchdog == NMI_LOCAL_APIC ||
	 * 		nmi_watchdog == NMI_IO_APIC)
	 * but since they are power of two we could use a
	 * cheaper way --cvg
	 */
	return nmi_watchdog & (NMI_LOCAL_APIC | NMI_IO_APIC);
}
#endif
#endif


void lapic_watchdog_stop(void);
int lapic_watchdog_init(unsigned nmi_hz);
int lapic_wd_event(unsigned nmi_hz);
unsigned lapic_adjust_nmi_hz(unsigned hz);
void disable_lapic_nmi_watchdog(void);
void enable_lapic_nmi_watchdog(void);
void stop_nmi(void);
void stop_nmi(void);
void restart_nmi(void);
void restart_nmi(void);


+0 −1
Original line number Original line Diff line number Diff line
@@ -48,7 +48,6 @@ static inline void __init smpboot_setup_io_apic(void)
		setup_IO_APIC();
		setup_IO_APIC();
	else {
	else {
		nr_ioapics = 0;
		nr_ioapics = 0;
		localise_nmi_watchdog();
	}
	}
#endif
#endif
}
}
+0 −6
Original line number Original line Diff line number Diff line
@@ -10,12 +10,6 @@
unsigned long long native_sched_clock(void);
unsigned long long native_sched_clock(void);
extern int recalibrate_cpu_khz(void);
extern int recalibrate_cpu_khz(void);


#if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC)
extern int timer_ack;
#else
# define timer_ack (0)
#endif

extern int no_timer_check;
extern int no_timer_check;


/* Accelerators for sched_clock()
/* Accelerators for sched_clock()
+1 −14
Original line number Original line Diff line number Diff line
@@ -31,7 +31,6 @@
#include <linux/init.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/cpu.h>
#include <linux/dmi.h>
#include <linux/dmi.h>
#include <linux/nmi.h>
#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/mm.h>
#include <linux/mm.h>


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


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


	setup_apic_nmi_watchdog(NULL);
	apic_pm_activate();
	apic_pm_activate();
}
}


@@ -1750,17 +1744,10 @@ int __init APIC_init_uniprocessor(void)
		setup_IO_APIC();
		setup_IO_APIC();
	else {
	else {
		nr_ioapics = 0;
		nr_ioapics = 0;
		localise_nmi_watchdog();
	}
	}
#else
	localise_nmi_watchdog();
#endif
#endif


	x86_init.timers.setup_percpu_clockev();
	x86_init.timers.setup_percpu_clockev();
#ifdef CONFIG_X86_64
	check_nmi_watchdog();
#endif

	return 0;
	return 0;
}
}


+0 −10
Original line number Original line Diff line number Diff line
@@ -94,14 +94,4 @@ early_initcall(register_trigger_all_cpu_backtrace);
#endif
#endif


/* STUB calls to mimic old nmi_watchdog behaviour */
/* STUB calls to mimic old nmi_watchdog behaviour */
#if defined(CONFIG_X86_LOCAL_APIC)
unsigned int nmi_watchdog = NMI_NONE;
EXPORT_SYMBOL(nmi_watchdog);
#endif
atomic_t nmi_active = ATOMIC_INIT(0);           /* oprofile uses this */
EXPORT_SYMBOL(nmi_active);
int unknown_nmi_panic;
int unknown_nmi_panic;
void cpu_nmi_set_wd_enabled(void) { return; }
void stop_apic_nmi_watchdog(void *unused) { return; }
void setup_apic_nmi_watchdog(void *unused) { return; }
int __init check_nmi_watchdog(void) { return 0; }
Loading