Re: [PATCH] x86, mce, severities: Add AMD severities function

From: Aravind Gopalakrishnan
Date: Fri Mar 20 2015 - 11:59:46 EST


On 3/19/2015 12:15 PM, Luck, Tony wrote:
It would be best if what Tony suggested comes ontop of your patch with
his Suggested-by: tag. This ordering should be also the easiest wrt
functionality and bisectability.


Ok, I'll have it ready and send out a V2 by tomorrow if there are no
other comments/reviews.
Fame & glory ... whatever. Just be sure to make the _intel() and _amd()
severity functions "static" ... so you'll need something like this in mce-severity.c

void mce_vendor_severity_init(void)
{
.... assign mce_severity here
}



Ok, Here's how I have it currently:
void __init mcheck_vendor_init_severity(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;

switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
mce_severity = mce_severity_intel;
break;
case X86_VENDOR_AMD:
mce_severity = mce_severity_amd;
break;
default:
break;
}
}
And I call this from mcheck_init().
I tested the above bits on AMD and the severities grading works fine.

Should we also come up with a '_default' function to assign to mce_severity function pointer?
Something like-
static int mce_severity_default(struct mce *m, int tolerant,
char **msg, bool is_excp)
{
pr_err("CPU#%d: No vendor specific severities grader assigned.
Implementing default grader\n", smp_processor_id());

if (m->status & MCI_STATUS_PCC || m->status & MCI_STATUS_OVER)
return MCE_PANIC_SEVERITY;

if (m->status & MCI_STATUS_UC)
return MCE_UC_SEVERITY;

return MCE_KEEP_SEVERITY;
}

int (*mce_severity) (struct mce *m, int tolerant, char **msg, bool is_excp) =
mce_severity_default;

How much of grading should '_default' do if at all?

Thanks,
-Aravind.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/