aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2016-11-28 02:50:57 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-02-04 03:36:59 -0500
commit07d495dae20717b00881798ef812f7aa53ca0eb3 (patch)
tree1971fa9711049b5f90653cfc9fc940722466f50f
parent68dee8e2f2cacc54d038394e70d22411dee89da2 (diff)
x86/traps: Get rid of unnecessary preempt_disable/preempt_enable_no_resched
Exception handlers which may run on IST stack call ist_enter() at the start of execution and ist_exit() in the end. ist_enter() disables preemption unconditionally and ist_exit() enables it. So the extra preempt_disable/enable() pairs nested inside the ist_enter/exit() regions are pointless and can be removed. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Jianyu Zhan <nasa4836@gmail.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@suse.de> Link: http://lkml.kernel.org/r/20161128075057.7724-1-kuleshovmail@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/traps.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index bf0c6d049080..1dc86ee60a03 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -563,11 +563,9 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
563 * as we may switch to the interrupt stack. 563 * as we may switch to the interrupt stack.
564 */ 564 */
565 debug_stack_usage_inc(); 565 debug_stack_usage_inc();
566 preempt_disable();
567 cond_local_irq_enable(regs); 566 cond_local_irq_enable(regs);
568 do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL); 567 do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL);
569 cond_local_irq_disable(regs); 568 cond_local_irq_disable(regs);
570 preempt_enable_no_resched();
571 debug_stack_usage_dec(); 569 debug_stack_usage_dec();
572exit: 570exit:
573 ist_exit(regs); 571 ist_exit(regs);
@@ -742,14 +740,12 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
742 debug_stack_usage_inc(); 740 debug_stack_usage_inc();
743 741
744 /* It's safe to allow irq's after DR6 has been saved */ 742 /* It's safe to allow irq's after DR6 has been saved */
745 preempt_disable();
746 cond_local_irq_enable(regs); 743 cond_local_irq_enable(regs);
747 744
748 if (v8086_mode(regs)) { 745 if (v8086_mode(regs)) {
749 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 746 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
750 X86_TRAP_DB); 747 X86_TRAP_DB);
751 cond_local_irq_disable(regs); 748 cond_local_irq_disable(regs);
752 preempt_enable_no_resched();
753 debug_stack_usage_dec(); 749 debug_stack_usage_dec();
754 goto exit; 750 goto exit;
755 } 751 }
@@ -769,7 +765,6 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
769 if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) 765 if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
770 send_sigtrap(tsk, regs, error_code, si_code); 766 send_sigtrap(tsk, regs, error_code, si_code);
771 cond_local_irq_disable(regs); 767 cond_local_irq_disable(regs);
772 preempt_enable_no_resched();
773 debug_stack_usage_dec(); 768 debug_stack_usage_dec();
774 769
775exit: 770exit: