Commit c3d7fa66 authored by Juergen Gross's avatar Juergen Gross Committed by Borislav Petkov

x86/xen: Use specific Xen pv interrupt entry for MCE

Xen PV guests don't use IST. For machine check interrupts, switch to the
same model as debug interrupts.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210120135555.32594-3-jgross@suse.com
parent 92bf2261
...@@ -585,6 +585,9 @@ DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check); ...@@ -585,6 +585,9 @@ DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check);
#else #else
DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check); DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check);
#endif #endif
#ifdef CONFIG_XEN_PV
DECLARE_IDTENTRY_RAW(X86_TRAP_MC, xenpv_exc_machine_check);
#endif
#endif #endif
/* NMI */ /* NMI */
......
...@@ -590,6 +590,20 @@ DEFINE_IDTENTRY_RAW(exc_xen_unknown_trap) ...@@ -590,6 +590,20 @@ DEFINE_IDTENTRY_RAW(exc_xen_unknown_trap)
BUG(); BUG();
} }
#ifdef CONFIG_X86_MCE
DEFINE_IDTENTRY_RAW(xenpv_exc_machine_check)
{
/*
* There's no IST on Xen PV, but we still need to dispatch
* to the correct handler.
*/
if (user_mode(regs))
noist_exc_machine_check(regs);
else
exc_machine_check(regs);
}
#endif
struct trap_array_entry { struct trap_array_entry {
void (*orig)(void); void (*orig)(void);
void (*xen)(void); void (*xen)(void);
...@@ -610,7 +624,7 @@ static struct trap_array_entry trap_array[] = { ...@@ -610,7 +624,7 @@ static struct trap_array_entry trap_array[] = {
TRAP_ENTRY_REDIR(exc_debug, true ), TRAP_ENTRY_REDIR(exc_debug, true ),
TRAP_ENTRY(exc_double_fault, true ), TRAP_ENTRY(exc_double_fault, true ),
#ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_MCE
TRAP_ENTRY(exc_machine_check, true ), TRAP_ENTRY_REDIR(exc_machine_check, true ),
#endif #endif
TRAP_ENTRY_REDIR(exc_nmi, true ), TRAP_ENTRY_REDIR(exc_nmi, true ),
TRAP_ENTRY(exc_int3, false ), TRAP_ENTRY(exc_int3, false ),
......
...@@ -172,7 +172,7 @@ xen_pv_trap asm_exc_spurious_interrupt_bug ...@@ -172,7 +172,7 @@ xen_pv_trap asm_exc_spurious_interrupt_bug
xen_pv_trap asm_exc_coprocessor_error xen_pv_trap asm_exc_coprocessor_error
xen_pv_trap asm_exc_alignment_check xen_pv_trap asm_exc_alignment_check
#ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_MCE
xen_pv_trap asm_exc_machine_check xen_pv_trap asm_xenpv_exc_machine_check
#endif /* CONFIG_X86_MCE */ #endif /* CONFIG_X86_MCE */
xen_pv_trap asm_exc_simd_coprocessor_error xen_pv_trap asm_exc_simd_coprocessor_error
#ifdef CONFIG_IA32_EMULATION #ifdef CONFIG_IA32_EMULATION
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment