Skip to content

Commit

Permalink
Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/tip/tip

Pull RAS updates from Ingo Molnar:
 "Two minor updates to AMD SMCA support, plus a timer_setup() conversion"

* 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/MCE/AMD: Fix mce_severity_amd_smca() signature
  x86/MCE/AMD: Always give panic severity for UC errors in kernel context
  x86/mce: Convert timers to use timer_setup()
  • Loading branch information
torvalds committed Nov 13, 2017
2 parents 3148637 + 783ca51 commit f2be8bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
9 changes: 4 additions & 5 deletions arch/x86/kernel/cpu/mcheck/mce-severity.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static int error_context(struct mce *m)
return IN_KERNEL;
}

static int mce_severity_amd_smca(struct mce *m, int err_ctx)
static int mce_severity_amd_smca(struct mce *m, enum context err_ctx)
{
u32 addr = MSR_AMD64_SMCA_MCx_CONFIG(m->bank);
u32 low, high;
Expand Down Expand Up @@ -245,6 +245,9 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc

if (m->status & MCI_STATUS_UC) {

if (ctx == IN_KERNEL)
return MCE_PANIC_SEVERITY;

/*
* On older systems where overflow_recov flag is not present, we
* should simply panic if an error overflow occurs. If
Expand All @@ -255,10 +258,6 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc
if (mce_flags.smca)
return mce_severity_amd_smca(m, ctx);

/* software can try to contain */
if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL))
return MCE_PANIC_SEVERITY;

/* kill current process */
return MCE_AR_SEVERITY;
} else {
Expand Down
13 changes: 5 additions & 8 deletions arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,13 +1367,12 @@ static void __start_timer(struct timer_list *t, unsigned long interval)
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);
int cpu = smp_processor_id();
struct timer_list *cpu_t = this_cpu_ptr(&mce_timer);
unsigned long iv;

WARN_ON(cpu != data);
WARN_ON(cpu_t != t);

iv = __this_cpu_read(mce_next_interval);

Expand Down Expand Up @@ -1763,17 +1762,15 @@ static void mce_start_timer(struct timer_list *t)
static void __mcheck_cpu_setup_timer(void)
{
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)
{
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);
}

Expand Down

0 comments on commit f2be8bd

Please sign in to comment.