[PATCH v3 00/10] x86/mce: Clean up some x86/mce code

From: Qiuxu Zhuo
Date: Thu Oct 24 2024 - 23:09:32 EST


Clean up some x86/mce code as below. No functional changes intended.

- Simplify some code.

- Remove some unnecessary code.

- Improve readability for some code.

- Convert some family/model mixed checks to VFM-based checks.

- Fix some typos.

Pass the following basic tests:

- Tested on an Intel Sapphire Rapids server.

- Compile test.

- System boot test.

- Correctable/uncorrectable memory errors can be notified via CMCI/MCE interrupts.

- Correctable/uncorrectable memory errors can be dispatched to the mcelog daemon and the EDAC driver.

Changes in v3:

- Collect "Reviewed-by:" from Nikolay & Sohil.

- Drop the "x86/mce: Remove the redundant zeroing assignments" patch.

- 0003: Rename mce_notify_irq() to mce_notify_user().

- 0005: Move the 'int ret' variable along with the other int variables.

- 0006: New patch. Break up __mcheck_cpu_apply_quirks().

- 0007: New patch. Convert family/model mixed checks to VFM-based checks.

- 0009: Remove the variable names from the commit message.

- 0010: Remove the detail typos from the commit message.

Changes in v2:

- Collect "Reviewed-by:" from Tony.

- 0009: Add the missing variable names to the commit message.

This series is based on v6.12-rc4.

Thanks Tony, Dave, Sohil and Nikolay for your review and discussion on this series.

Qiuxu Zhuo (9):
x86/mce/dev-mcelog: Use xchg() to get and clear the flags
x86/mce/intel: Use MCG_BANKCNT_MASK instead of 0xff
x86/mce: Make several functions return bool and rename a function
x86/mce/threshold: Remove the redundant this_cpu_dec_return()
x86/mce/genpool: Make mce_gen_pool_create() return explicit error codes
x86/mce: Convert family/model mixed checks to VFM-based checks
x86/mce: Remove the unnecessary {}
x86/mce/amd: Remove unnecessary NULL pointer initializations
x86/mce: Fix typos

Tony Luck (1):
x86/mce: Break up __mcheck_cpu_apply_quirks()

arch/x86/include/asm/mce.h | 4 +-
arch/x86/kernel/cpu/mce/amd.c | 18 +--
arch/x86/kernel/cpu/mce/core.c | 230 +++++++++++++++------------
arch/x86/kernel/cpu/mce/dev-mcelog.c | 11 +-
arch/x86/kernel/cpu/mce/genpool.c | 9 +-
arch/x86/kernel/cpu/mce/inject.c | 2 +-
arch/x86/kernel/cpu/mce/intel.c | 11 +-
arch/x86/kernel/cpu/mce/threshold.c | 2 +-
8 files changed, 149 insertions(+), 138 deletions(-)


base-commit: 42f7652d3eb527d03665b09edac47f85fb600924
--
2.17.1