[PATCH V2 28/41] x86/debug, mce: Use C entry code

From: Lai Jiangshan
Date: Sun Sep 26 2021 - 11:12:16 EST


From: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>

Use DEFINE_IDTENTRY_IST_ETNRY to emit C entry function and use the function
directly in entry_64.S.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxxxxx>
---
arch/x86/entry/entry_64.S | 10 +---------
arch/x86/include/asm/idtentry.h | 1 +
2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index bd6bce341360..0ba788bb9857 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -437,16 +437,8 @@ SYM_CODE_START(\asmsym)
testb $3, CS(%rsp)
jnz .Lfrom_usermode_switch_stack_\@

- /* paranoid_entry returns GS information for paranoid_exit in EBX. */
- call paranoid_entry
-
- UNWIND_HINT_REGS
-
movq %rsp, %rdi /* pt_regs pointer */
-
- call \cfunc
-
- call paranoid_exit
+ call ist_\cfunc
jmp restore_regs_and_return_to_kernel

/* Switch to the regular task stack and use the noist entry point */
diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h
index b33e96e983c0..babe530cfa77 100644
--- a/arch/x86/include/asm/idtentry.h
+++ b/arch/x86/include/asm/idtentry.h
@@ -344,6 +344,7 @@ __visible __entry_text void ist_##func(struct pt_regs *regs) \
* Maps to DEFINE_IDTENTRY_RAW
*/
#define DEFINE_IDTENTRY_IST(func) \
+ DEFINE_IDTENTRY_IST_ETNRY(func) \
DEFINE_IDTENTRY_RAW(func)

/**
--
2.19.1.6.gb485710b