Skip to content

Commit

Permalink
Merge branch 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/tip/tip

Pull x86 interrupt updates from Thomas Gleixner:
 "A small set of changes to simplify and improve the interrupt handling
  in do_IRQ() by moving the common case into common code and thereby
  cleaning it up"

* 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Check for VECTOR_UNUSED directly
  x86/irq: Move IS_ERR_OR_NULL() check into common do_IRQ() code
  x86/irq: Improve definition of VECTOR_SHUTDOWN et al
  • Loading branch information
Linus Torvalds committed Sep 17, 2019
2 parents 3fb7f3a + 8725fcd commit 258b16e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
4 changes: 2 additions & 2 deletions arch/x86/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ extern char irq_entries_start[];
extern char spurious_entries_start[];

#define VECTOR_UNUSED NULL
#define VECTOR_SHUTDOWN ((void *)~0UL)
#define VECTOR_RETRIGGERED ((void *)~1UL)
#define VECTOR_SHUTDOWN ((void *)-1L)
#define VECTOR_RETRIGGERED ((void *)-2L)

typedef struct irq_desc* vector_irq_t[NR_VECTORS];
DECLARE_PER_CPU(vector_irq_t, vector_irq);
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs);
extern void (*x86_platform_ipi_callback)(void);
extern void native_init_IRQ(void);

extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
extern void handle_irq(struct irq_desc *desc, struct pt_regs *regs);

extern __visible unsigned int do_IRQ(struct pt_regs *regs);

Expand Down
10 changes: 7 additions & 3 deletions arch/x86/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU");

desc = __this_cpu_read(vector_irq[vector]);

if (!handle_irq(desc, regs)) {
if (likely(!IS_ERR_OR_NULL(desc))) {
if (IS_ENABLED(CONFIG_X86_32))
handle_irq(desc, regs);
else
generic_handle_irq_desc(desc);
} else {
ack_APIC_irq();

if (desc != VECTOR_RETRIGGERED && desc != VECTOR_SHUTDOWN) {
if (desc == VECTOR_UNUSED) {
pr_emerg_ratelimited("%s: %d.%d No irq handler for vector\n",
__func__, smp_processor_id(),
vector);
Expand Down
7 changes: 1 addition & 6 deletions arch/x86/kernel/irq_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,13 @@ void do_softirq_own_stack(void)
call_on_stack(__do_softirq, isp);
}

bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
void handle_irq(struct irq_desc *desc, struct pt_regs *regs)
{
int overflow = check_stack_overflow();

if (IS_ERR_OR_NULL(desc))
return false;

if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) {
if (unlikely(overflow))
print_stack_overflow();
generic_handle_irq_desc(desc);
}

return true;
}
9 changes: 0 additions & 9 deletions arch/x86/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible;
DECLARE_INIT_PER_CPU(irq_stack_backing_store);

bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
{
if (IS_ERR_OR_NULL(desc))
return false;

generic_handle_irq_desc(desc);
return true;
}

#ifdef CONFIG_VMAP_STACK
/*
* VMAP the backing store with guard pages
Expand Down

0 comments on commit 258b16e

Please sign in to comment.