Commit 92bb6cb1 authored by Kees Cook's avatar Kees Cook Committed by Thomas Gleixner

x86/mce: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Adjust sanity-check WARN to make sure
the triggering timer matches the current CPU timer.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarBorislav Petkov <bp@alien8.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac@vger.kernel.org
Link: https://lkml.kernel.org/r/20171005005425.GA23950@beast
parent d81fa669
...@@ -1367,13 +1367,12 @@ static void __start_timer(struct timer_list *t, unsigned long interval) ...@@ -1367,13 +1367,12 @@ static void __start_timer(struct timer_list *t, unsigned long interval)
local_irq_restore(flags); local_irq_restore(flags);
} }
static void mce_timer_fn(unsigned long data) static void mce_timer_fn(struct timer_list *t)
{ {
struct timer_list *t = this_cpu_ptr(&mce_timer); struct timer_list *cpu_t = this_cpu_ptr(&mce_timer);
int cpu = smp_processor_id();
unsigned long iv; unsigned long iv;
WARN_ON(cpu != data); WARN_ON(cpu_t != t);
iv = __this_cpu_read(mce_next_interval); iv = __this_cpu_read(mce_next_interval);
...@@ -1763,17 +1762,15 @@ static void mce_start_timer(struct timer_list *t) ...@@ -1763,17 +1762,15 @@ static void mce_start_timer(struct timer_list *t)
static void __mcheck_cpu_setup_timer(void) static void __mcheck_cpu_setup_timer(void)
{ {
struct timer_list *t = this_cpu_ptr(&mce_timer); struct timer_list *t = this_cpu_ptr(&mce_timer);
unsigned int cpu = smp_processor_id();
setup_pinned_timer(t, mce_timer_fn, cpu); timer_setup(t, mce_timer_fn, TIMER_PINNED);
} }
static void __mcheck_cpu_init_timer(void) static void __mcheck_cpu_init_timer(void)
{ {
struct timer_list *t = this_cpu_ptr(&mce_timer); struct timer_list *t = this_cpu_ptr(&mce_timer);
unsigned int cpu = smp_processor_id();
setup_pinned_timer(t, mce_timer_fn, cpu); timer_setup(t, mce_timer_fn, TIMER_PINNED);
mce_start_timer(t); mce_start_timer(t);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment