On Mon, Mar 16, 2015 at 12:16:04PM -0500, Aravind Gopalakrishnan wrote:
+/* keeping amd_mce_severity in sync with AMD error scope heirarchy table */we're testing mce_flags.overflow_recov twice here, perhaps do instead:
+static int amd_mce_severity(struct mce *m, enum context ctx)
+{
+ /* Processor Context Corrupt, no need to fumble too much, die! */
+ if (m->status & MCI_STATUS_PCC)
+ return MCE_PANIC_SEVERITY;
+
+ if (m->status & MCI_STATUS_UC) {
+ /*
+ * On older systems, where overflow_recov flag is not
+ * present, we should simply PANIC if Overflow occurs.
+ * If overflow_recov flag set, then SW can try
+ * to at least kill process to salvage systen operation.
+ */
+
+ /* at least one error was not logged */
+ if (m->status & MCI_STATUS_OVER && !mce_flags.overflow_recov)
+ return MCE_PANIC_SEVERITY;
+
+ /* software can try to contain */
+ if (!(m->mcgstatus & MCG_STATUS_RIPV) &&
+ mce_flags.overflow_recov) {
+ if (ctx == IN_KERNEL)
+ return MCE_PANIC_SEVERITY;
/*
* < Comment about overflow recovery bit>
*/
if (mce_flags.overflow_recov) {
if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL))
return MCE_PANIC_SEVERITY;
} else {
if (m->status & MCI_STATUS_OVER)
return MCE_PANIC_SEVERITY;
}