提交 2891e8e6 编写于 作者: L Linus Torvalds

Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Ingo Molnar:
 "Two small cleanups"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/traps: Get rid of unnecessary preempt_disable/preempt_enable_no_resched
  x86/pci-calgary: Fix iommu_free() comparison of unsigned expression >= 0
...@@ -296,7 +296,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, ...@@ -296,7 +296,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr,
/* were we called with bad_dma_address? */ /* were we called with bad_dma_address? */
badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE); badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE);
if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) { if (unlikely(dma_addr < badend)) {
WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA "
"address 0x%Lx\n", dma_addr); "address 0x%Lx\n", dma_addr);
return; return;
......
...@@ -563,11 +563,9 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code) ...@@ -563,11 +563,9 @@ dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
* as we may switch to the interrupt stack. * as we may switch to the interrupt stack.
*/ */
debug_stack_usage_inc(); debug_stack_usage_inc();
preempt_disable();
cond_local_irq_enable(regs); cond_local_irq_enable(regs);
do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL); do_trap(X86_TRAP_BP, SIGTRAP, "int3", regs, error_code, NULL);
cond_local_irq_disable(regs); cond_local_irq_disable(regs);
preempt_enable_no_resched();
debug_stack_usage_dec(); debug_stack_usage_dec();
exit: exit:
ist_exit(regs); ist_exit(regs);
...@@ -742,14 +740,12 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code) ...@@ -742,14 +740,12 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
debug_stack_usage_inc(); debug_stack_usage_inc();
/* It's safe to allow irq's after DR6 has been saved */ /* It's safe to allow irq's after DR6 has been saved */
preempt_disable();
cond_local_irq_enable(regs); cond_local_irq_enable(regs);
if (v8086_mode(regs)) { if (v8086_mode(regs)) {
handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code,
X86_TRAP_DB); X86_TRAP_DB);
cond_local_irq_disable(regs); cond_local_irq_disable(regs);
preempt_enable_no_resched();
debug_stack_usage_dec(); debug_stack_usage_dec();
goto exit; goto exit;
} }
...@@ -769,7 +765,6 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code) ...@@ -769,7 +765,6 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code)
if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp) if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
send_sigtrap(tsk, regs, error_code, si_code); send_sigtrap(tsk, regs, error_code, si_code);
cond_local_irq_disable(regs); cond_local_irq_disable(regs);
preempt_enable_no_resched();
debug_stack_usage_dec(); debug_stack_usage_dec();
exit: exit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册