Skip to content

Commit 258b16e

Browse files
committed
Merge branch 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/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
2 parents 3fb7f3a + 8725fcd commit 258b16e

File tree

5 files changed

+11
-21
lines changed

5 files changed

+11
-21
lines changed

arch/x86/include/asm/hw_irq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ extern char irq_entries_start[];
153153
extern char spurious_entries_start[];
154154

155155
#define VECTOR_UNUSED NULL
156-
#define VECTOR_SHUTDOWN ((void *)~0UL)
157-
#define VECTOR_RETRIGGERED ((void *)~1UL)
156+
#define VECTOR_SHUTDOWN ((void *)-1L)
157+
#define VECTOR_RETRIGGERED ((void *)-2L)
158158

159159
typedef struct irq_desc* vector_irq_t[NR_VECTORS];
160160
DECLARE_PER_CPU(vector_irq_t, vector_irq);

arch/x86/include/asm/irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern __visible void smp_kvm_posted_intr_nested_ipi(struct pt_regs *regs);
3434
extern void (*x86_platform_ipi_callback)(void);
3535
extern void native_init_IRQ(void);
3636

37-
extern bool handle_irq(struct irq_desc *desc, struct pt_regs *regs);
37+
extern void handle_irq(struct irq_desc *desc, struct pt_regs *regs);
3838

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

arch/x86/kernel/irq.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
243243
RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU");
244244

245245
desc = __this_cpu_read(vector_irq[vector]);
246-
247-
if (!handle_irq(desc, regs)) {
246+
if (likely(!IS_ERR_OR_NULL(desc))) {
247+
if (IS_ENABLED(CONFIG_X86_32))
248+
handle_irq(desc, regs);
249+
else
250+
generic_handle_irq_desc(desc);
251+
} else {
248252
ack_APIC_irq();
249253

250-
if (desc != VECTOR_RETRIGGERED && desc != VECTOR_SHUTDOWN) {
254+
if (desc == VECTOR_UNUSED) {
251255
pr_emerg_ratelimited("%s: %d.%d No irq handler for vector\n",
252256
__func__, smp_processor_id(),
253257
vector);

arch/x86/kernel/irq_32.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,13 @@ void do_softirq_own_stack(void)
148148
call_on_stack(__do_softirq, isp);
149149
}
150150

151-
bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
151+
void handle_irq(struct irq_desc *desc, struct pt_regs *regs)
152152
{
153153
int overflow = check_stack_overflow();
154154

155-
if (IS_ERR_OR_NULL(desc))
156-
return false;
157-
158155
if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) {
159156
if (unlikely(overflow))
160157
print_stack_overflow();
161158
generic_handle_irq_desc(desc);
162159
}
163-
164-
return true;
165160
}

arch/x86/kernel/irq_64.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@
2626
DEFINE_PER_CPU_PAGE_ALIGNED(struct irq_stack, irq_stack_backing_store) __visible;
2727
DECLARE_INIT_PER_CPU(irq_stack_backing_store);
2828

29-
bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
30-
{
31-
if (IS_ERR_OR_NULL(desc))
32-
return false;
33-
34-
generic_handle_irq_desc(desc);
35-
return true;
36-
}
37-
3829
#ifdef CONFIG_VMAP_STACK
3930
/*
4031
* VMAP the backing store with guard pages

0 commit comments

Comments
 (0)