Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/RAS: Remove mce.usable_addr

It is useless and we can use the function instead. Besides,
mcelog(8) hasn't managed to make use of it yet. So kill it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1448350880-5573-3-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Borislav Petkov and committed by
Ingo Molnar
c0ec382e 8b38937b

+5 -9
+1 -1
arch/x86/include/uapi/asm/mce.h
··· 16 16 __u8 cpuvendor; /* cpu vendor as encoded in system.h */ 17 17 __u8 inject_flags; /* software inject flags */ 18 18 __u8 severity; 19 - __u8 usable_addr; 19 + __u8 pad; 20 20 __u32 cpuid; /* CPUID 1 EAX */ 21 21 __u8 cs; /* code segment */ 22 22 __u8 bank; /* machine check bank */
+4 -8
arch/x86/kernel/cpu/mcheck/mce.c
··· 484 484 if (!mce) 485 485 return NOTIFY_DONE; 486 486 487 - if (mce->usable_addr && (mce->severity == MCE_AO_SEVERITY)) { 487 + if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) { 488 488 pfn = mce->addr >> PAGE_SHIFT; 489 489 memory_failure(pfn, MCE_VECTOR, 0); 490 490 } ··· 610 610 611 611 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false); 612 612 613 - if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m)) { 614 - if (m.status & MCI_STATUS_ADDRV) { 613 + if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m)) 614 + if (m.status & MCI_STATUS_ADDRV) 615 615 m.severity = severity; 616 - m.usable_addr = mce_usable_address(&m); 617 - } 618 - } 619 616 620 617 /* 621 618 * Don't get the IP here because it's unlikely to ··· 620 623 */ 621 624 if (!(flags & MCP_DONTLOG) && !mca_cfg.dont_log_ce) 622 625 mce_log(&m); 623 - else if (m.usable_addr) { 626 + else if (mce_usable_address(&m)) { 624 627 /* 625 628 * Although we skipped logging this, we still want 626 629 * to take action. Add to the pool so the registered ··· 1088 1091 1089 1092 /* assuming valid severity level != 0 */ 1090 1093 m.severity = severity; 1091 - m.usable_addr = mce_usable_address(&m); 1092 1094 1093 1095 mce_log(&m); 1094 1096