Commit 8cd501c1 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/entry: Convert Machine Check to IDTENTRY_IST



Convert #MC to IDTENTRY_MCE:
  - Implement the C entry points with DEFINE_IDTENTRY_MCE
  - Emit the ASM stub with DECLARE_IDTENTRY_MCE
  - Remove the ASM idtentry in 64bit
  - Remove the open coded ASM entry code in 32bit
  - Fixup the XEN/PV code
  - Remove the old prototypes
  - Remove the error code from *machine_check_vector() as
    it is always 0 and not used by any of the functions
    it can point to. Fixup all the functions as well.

No functional change.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarAlexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
Link: https://lkml.kernel.org/r/20200505135314.334980426@linutronix.de


parent 94a46d31
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1297,15 +1297,6 @@ SYM_CODE_START(native_iret)
SYM_CODE_END(native_iret)
#endif

#ifdef CONFIG_X86_MCE
SYM_CODE_START(machine_check)
	ASM_CLAC
	pushl	$0
	pushl	$do_mce
	jmp	common_exception
SYM_CODE_END(machine_check)
#endif

#ifdef CONFIG_XEN_PV
SYM_FUNC_START(xen_hypervisor_callback)
	/*
+0 −3
Original line number Diff line number Diff line
@@ -1074,9 +1074,6 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt

idtentry	X86_TRAP_PF		page_fault		do_page_fault			has_error_code=1

#ifdef CONFIG_X86_MCE
idtentry_mce_db	X86_TRAP_MCE	 	machine_check		do_mce
#endif
idtentry_mce_db	X86_TRAP_DB		debug			do_debug
idtentry_df	X86_TRAP_DF		double_fault		do_double_fault

+4 −0
Original line number Diff line number Diff line
@@ -238,4 +238,8 @@ DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_AC, exc_alignment_check);
/* Raw exception entries which need extra work */
DECLARE_IDTENTRY_RAW(X86_TRAP_BP,	exc_int3);

#ifdef CONFIG_X86_MCE
DECLARE_IDTENTRY_MCE(X86_TRAP_MC,	exc_machine_check);
#endif

#endif
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ extern void mce_disable_bank(int bank);
/*
 * Exception handler
 */
void do_machine_check(struct pt_regs *, long);
void do_machine_check(struct pt_regs *pt_regs);

/*
 * Threshold handler
+0 −7
Original line number Diff line number Diff line
@@ -18,25 +18,18 @@ asmlinkage void double_fault(void);
#endif
asmlinkage void page_fault(void);
asmlinkage void async_page_fault(void);
#ifdef CONFIG_X86_MCE
asmlinkage void machine_check(void);
#endif /* CONFIG_X86_MCE */

#if defined(CONFIG_X86_64) && defined(CONFIG_XEN_PV)
asmlinkage void xen_xennmi(void);
asmlinkage void xen_xendebug(void);
asmlinkage void xen_double_fault(void);
asmlinkage void xen_page_fault(void);
#ifdef CONFIG_X86_MCE
asmlinkage void xen_machine_check(void);
#endif /* CONFIG_X86_MCE */
#endif

dotraplinkage void do_debug(struct pt_regs *regs, long error_code);
dotraplinkage void do_nmi(struct pt_regs *regs, long error_code);
dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code, unsigned long cr2);
dotraplinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address);
dotraplinkage void do_mce(struct pt_regs *regs, long error_code);

#ifdef CONFIG_X86_64
asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs);
Loading