diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 17:34:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 17:34:23 -0500 |
commit | 2891e8e66787a6a5dadad017d1c8a8f23d8658af (patch) | |
tree | ff7a51aa00972689c54f1a14427288defc264660 | |
parent | 292d38674301c6fbee3965e446bd1c8a6672a400 (diff) | |
parent | 07d495dae20717b00881798ef812f7aa53ca0eb3 (diff) |
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
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/traps.c | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 5d400ba1349d..d47517941bbc 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -296,7 +296,7 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, | |||
296 | 296 | ||
297 | /* were we called with bad_dma_address? */ | 297 | /* were we called with bad_dma_address? */ |
298 | badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE); | 298 | badend = DMA_ERROR_CODE + (EMERGENCY_PAGES * PAGE_SIZE); |
299 | if (unlikely((dma_addr >= DMA_ERROR_CODE) && (dma_addr < badend))) { | 299 | if (unlikely(dma_addr < badend)) { |
300 | WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " | 300 | WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " |
301 | "address 0x%Lx\n", dma_addr); | 301 | "address 0x%Lx\n", dma_addr); |
302 | return; | 302 | return; |
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(); |
572 | exit: | 570 | exit: |
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 | ||
775 | exit: | 770 | exit: |