Skip to content

RFC: x86/mce: Deprecate mcelog and other funsies

Borislav Petkov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4RAS: Add a Corrected Errors Collectorarch/x86/kernel/cpu/mcheck/mce.c arch/x86/ras/Kconfig drivers/ras/Makefile +4 more+521 -602 replies
2/4x86/mce: Deprecate /dev/mcelogarch/x86/Kconfig arch/x86/kernel/cpu/mcheck/Makefile arch/x86/kernel/cpu/mcheck/dev-mcelog.c +2 more+445 -3771 reply
3/4x86/mce: Merge mce_amd_inj into mce-injectarch/x86/Kconfig arch/x86/kernel/cpu/mcheck/mce-inject.c arch/x86/ras/Makefile +1 more+515 -4980 replies
4/4x86/mce-inject: Use debugfs_remove_recursive()arch/x86/kernel/cpu/mcheck/mce-inject.c+12 -180 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchThomas Gleixner
1/4
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [R-F-C PATCH 0/4] RFC: x86/mce: Deprecate mcelog and other funsies

From: Borislav Petkov <[email protected]>

So this set cannot have a bigger "RFC" tag:

It attempts to revive the correctable errors collector. In this version, the thing gets counters in debugfs:

(debugfs)/ras/cec/
|-- array
`-- pfn

which give some stats on the CEC like how many CEs it caught and the number of pages it soft-offlined due to excessive amount of CEs.

$ cat ras/cec/array
{ n: 2
 000: [0000000000000012|001]
 001: [0000003735928559|e01]
}
Stats:
 CEs: 514
 offlined pages: 0
Flags: 0x0

Then, we stuck all the /dev/mcelog functionality behind a CONFIG_X86_MCELOG which people can disable if they don't need mcelog and are going to use the rasdaemon. This is probably going to happen sooner or later with the distros anyway.

And then, as a result of that move, mce-inject is being made independent from mcelog and gets the error injection debugfs nodes of mce_amd_inj which you can echo into and don't need special tools:

$ tree --charset=ascii /sys/kernel/debug/mce-inject/
/sys/kernel/debug/mce-inject/
|-- addr
|-- bank
|-- cpu
|-- flags
|-- misc
|-- README
`-- status

0 directories, 7 files

Comments are more than welcome, Tony and will be polishing on those but thought it would be a nice point in time to send them out to get other people's opinions.

Thanks.

Borislav Petkov (3):
RAS: Add a Corrected Errors Collector
x86/mce: Merge mce_amd_inj into mce-inject
x86/mce-inject: Use debugfs_remove_recursive()

Tony Luck (1):
x86/mce: Deprecate /dev/mcelog

 arch/x86/Kconfig                          |   8 +
 arch/x86/kernel/cpu/mcheck/Makefile       |   2 +
 arch/x86/kernel/cpu/mcheck/dev-mcelog.c   | 397 +++++++++++++++++++++++
 arch/x86/kernel/cpu/mcheck/mce-inject.c   | 519 +++++++++++++++++++++++++++++-
 arch/x86/kernel/cpu/mcheck/mce-internal.h |   8 +
 arch/x86/kernel/cpu/mcheck/mce.c          | 513 +++++------------------------
 arch/x86/ras/Kconfig                      |  11 +
 arch/x86/ras/Makefile                     |   2 -
 arch/x86/ras/mce_amd_inj.c                | 484 ----------------------------
 drivers/ras/Makefile                      |   3 +-
 drivers/ras/cec.c                         | 425 ++++++++++++++++++++++++
 drivers/ras/debugfs.c                     |   2 +-
 drivers/ras/debugfs.h                     |   8 +
 include/linux/ras.h                       |  12 +-
 14 files changed, 1467 insertions(+), 927 deletions(-)
 create mode 100644 arch/x86/kernel/cpu/mcheck/dev-mcelog.c
 delete mode 100644 arch/x86/ras/mce_amd_inj.c
 create mode 100644 drivers/ras/cec.c
 create mode 100644 drivers/ras/debugfs.h
Signature · 1 line
2.7.3