[PATCH] x86/mce: update outdated comment for refactored ex_has_fault_handler()

From: Kexin Sun

Date: Sat Mar 21 2026 - 07:07:25 EST


The function ex_has_fault_handler() was refactored into
ex_get_fault_handler_type() by commit a05d54c41ecf ("x86/mce:
Provide method to find out the type of an exception handler"),
and then into ex_get_fixup_type() by commit 46d28947d987
("x86/extable: Rework the exception table mechanics").

The comment in do_machine_check() still referenced the old
function and _ASM_EXTABLE_FAULT(). Update the comment to
describe the current MCE-safe exception table mechanism
(EX_TYPE_FAULT_MCE_SAFE / EX_TYPE_DEFAULT_MCE_SAFE) and
the severity grading code that sets MCE_IN_KERNEL_RECOV.

Assisted-by: unnamed:deepseek-v3.2 coccinelle
Signed-off-by: Kexin Sun <kexinsun@xxxxxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/mce/core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 8dd424ac5de8..fa9ab282cede 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1713,12 +1713,12 @@ noinstr void do_machine_check(struct pt_regs *regs)
} else {
/*
* Handle an MCE which has happened in kernel space but from
- * which the kernel can recover: ex_has_fault_handler() has
- * already verified that the rIP at which the error happened is
- * a rIP from which the kernel can recover (by jumping to
- * recovery code specified in _ASM_EXTABLE_FAULT()) and the
- * corresponding exception handler which would do that is the
- * proper one.
+ * which the kernel can recover: the severity grading code
+ * has already verified that the rIP at which the error
+ * happened is covered by an MCE-safe exception table entry
+ * (EX_TYPE_FAULT_MCE_SAFE or EX_TYPE_DEFAULT_MCE_SAFE),
+ * from which the kernel can recover by jumping to the
+ * associated fixup code.
*/
if (m->kflags & MCE_IN_KERNEL_RECOV) {
if (!fixup_exception(regs, X86_TRAP_MC, 0, 0))
--
2.25.1