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

x86/extable: Provide EX_TYPE_DEFAULT_MCE_SAFE and EX_TYPE_FAULT_MCE_SAFE

Provide exception fixup types which can be used to identify fixups which
allow in kernel #MC recovery and make them invoke the existing handlers.

These will be used at places where #MC recovery is handled correctly by the
caller.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210908132525.269689153@linutronix.de

authored by

Thomas Gleixner and committed by
Borislav Petkov
2cadf524 46d28947

+7
+3
arch/x86/include/asm/extable_fixup_types.h
··· 16 16 #define EX_TYPE_WRMSR_IN_MCE 10 17 17 #define EX_TYPE_RDMSR_IN_MCE 11 18 18 19 + #define EX_TYPE_DEFAULT_MCE_SAFE 12 20 + #define EX_TYPE_FAULT_MCE_SAFE 13 21 + 19 22 #endif
+2
arch/x86/kernel/cpu/mce/severity.c
··· 278 278 m->kflags |= MCE_IN_KERNEL_COPYIN; 279 279 fallthrough; 280 280 case EX_TYPE_FAULT: 281 + case EX_TYPE_FAULT_MCE_SAFE: 282 + case EX_TYPE_DEFAULT_MCE_SAFE: 281 283 m->kflags |= MCE_IN_KERNEL_RECOV; 282 284 return IN_KERNEL_RECOV; 283 285 default:
+2
arch/x86/mm/extable.c
··· 131 131 132 132 switch (e->type) { 133 133 case EX_TYPE_DEFAULT: 134 + case EX_TYPE_DEFAULT_MCE_SAFE: 134 135 return ex_handler_default(e, regs); 135 136 case EX_TYPE_FAULT: 137 + case EX_TYPE_FAULT_MCE_SAFE: 136 138 return ex_handler_fault(e, regs, trapnr); 137 139 case EX_TYPE_UACCESS: 138 140 return ex_handler_uaccess(e, regs, trapnr);