ia64/xen-unstable

changeset 6057:b60643391488

Fix hw_resend_irq() -- IRQ_PENDING must be propagated back
to evtchn_pending[] bit during irq_enable, or the delayed
callback may never happen.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Aug 08 09:12:22 2005 +0000 (2005-08-08)
parents 41ceeb6828b5
children a9ee400a5da9
files linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/hw_irq.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hw_irq.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Mon Aug 08 08:32:52 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Mon Aug 08 09:12:22 2005 +0000
     1.3 @@ -610,6 +610,16 @@ static struct hw_interrupt_type pirq_typ
     1.4      set_affinity_irq
     1.5  };
     1.6  
     1.7 +void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
     1.8 +{
     1.9 +    int evtchn = irq_to_evtchn[i];
    1.10 +    shared_info_t *s = HYPERVISOR_shared_info;
    1.11 +    if ( !VALID_EVTCHN(evtchn) )
    1.12 +        return;
    1.13 +    BUG_ON(!synch_test_bit(evtchn, &s->evtchn_mask[0]));
    1.14 +    synch_set_bit(evtchn, &s->evtchn_pending[0]);
    1.15 +}
    1.16 +
    1.17  void irq_suspend(void)
    1.18  {
    1.19      int pirq, virq, irq, evtchn;
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hw_irq.h	Mon Aug 08 09:12:22 2005 +0000
     2.3 @@ -0,0 +1,71 @@
     2.4 +#ifndef _ASM_HW_IRQ_H
     2.5 +#define _ASM_HW_IRQ_H
     2.6 +
     2.7 +/*
     2.8 + *	linux/include/asm/hw_irq.h
     2.9 + *
    2.10 + *	(C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
    2.11 + *
    2.12 + *	moved some of the old arch/i386/kernel/irq.h to here. VY
    2.13 + *
    2.14 + *	IRQ/IPI changes taken from work by Thomas Radke
    2.15 + *	<tomsoft@informatik.tu-chemnitz.de>
    2.16 + */
    2.17 +
    2.18 +#include <linux/config.h>
    2.19 +#include <linux/profile.h>
    2.20 +#include <asm/atomic.h>
    2.21 +#include <asm/irq.h>
    2.22 +#include <asm/sections.h>
    2.23 +
    2.24 +/*
    2.25 + * Various low-level irq details needed by irq.c, process.c,
    2.26 + * time.c, io_apic.c and smp.c
    2.27 + *
    2.28 + * Interrupt entry/exit code at both C and assembly level
    2.29 + */
    2.30 +
    2.31 +extern u8 irq_vector[NR_IRQ_VECTORS];
    2.32 +#define IO_APIC_VECTOR(irq)	(irq_vector[irq])
    2.33 +#define AUTO_ASSIGN		-1
    2.34 +
    2.35 +extern void (*interrupt[NR_IRQS])(void);
    2.36 +
    2.37 +#ifdef CONFIG_SMP
    2.38 +fastcall void reschedule_interrupt(void);
    2.39 +fastcall void invalidate_interrupt(void);
    2.40 +fastcall void call_function_interrupt(void);
    2.41 +#endif
    2.42 +
    2.43 +#ifdef CONFIG_X86_LOCAL_APIC
    2.44 +fastcall void apic_timer_interrupt(void);
    2.45 +fastcall void error_interrupt(void);
    2.46 +fastcall void spurious_interrupt(void);
    2.47 +fastcall void thermal_interrupt(struct pt_regs *);
    2.48 +#define platform_legacy_irq(irq)	((irq) < 16)
    2.49 +#endif
    2.50 +
    2.51 +void disable_8259A_irq(unsigned int irq);
    2.52 +void enable_8259A_irq(unsigned int irq);
    2.53 +int i8259A_irq_pending(unsigned int irq);
    2.54 +void make_8259A_irq(unsigned int irq);
    2.55 +void init_8259A(int aeoi);
    2.56 +void FASTCALL(send_IPI_self(int vector));
    2.57 +void init_VISWS_APIC_irqs(void);
    2.58 +void setup_IO_APIC(void);
    2.59 +void disable_IO_APIC(void);
    2.60 +void print_IO_APIC(void);
    2.61 +int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
    2.62 +void send_IPI(int dest, int vector);
    2.63 +void setup_ioapic_dest(void);
    2.64 +
    2.65 +extern unsigned long io_apic_irqs;
    2.66 +
    2.67 +extern atomic_t irq_err_count;
    2.68 +extern atomic_t irq_mis_count;
    2.69 +
    2.70 +#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
    2.71 +
    2.72 +extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i);
    2.73 +
    2.74 +#endif /* _ASM_HW_IRQ_H */
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hw_irq.h	Mon Aug 08 09:12:22 2005 +0000
     3.3 @@ -0,0 +1,137 @@
     3.4 +#ifndef _ASM_HW_IRQ_H
     3.5 +#define _ASM_HW_IRQ_H
     3.6 +
     3.7 +/*
     3.8 + *	linux/include/asm/hw_irq.h
     3.9 + *
    3.10 + *	(C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
    3.11 + *
    3.12 + *	moved some of the old arch/i386/kernel/irq.h to here. VY
    3.13 + *
    3.14 + *	IRQ/IPI changes taken from work by Thomas Radke
    3.15 + *	<tomsoft@informatik.tu-chemnitz.de>
    3.16 + *
    3.17 + *	hacked by Andi Kleen for x86-64.
    3.18 + * 
    3.19 + *  $Id: hw_irq.h,v 1.24 2001/09/14 20:55:03 vojtech Exp $
    3.20 + */
    3.21 +
    3.22 +#ifndef __ASSEMBLY__
    3.23 +#include <linux/config.h>
    3.24 +#include <asm/atomic.h>
    3.25 +#include <asm/irq.h>
    3.26 +#include <linux/profile.h>
    3.27 +#include <linux/smp.h>
    3.28 +
    3.29 +struct hw_interrupt_type;
    3.30 +#endif
    3.31 +
    3.32 +/*
    3.33 + * IDT vectors usable for external interrupt sources start
    3.34 + * at 0x20:
    3.35 + */
    3.36 +#define FIRST_EXTERNAL_VECTOR	0x20
    3.37 +
    3.38 +#define IA32_SYSCALL_VECTOR	0x80
    3.39 +
    3.40 +
    3.41 +/*
    3.42 + * Vectors 0x20-0x2f are used for ISA interrupts.
    3.43 + */
    3.44 +
    3.45 +/*
    3.46 + * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
    3.47 + *
    3.48 + *  some of the following vectors are 'rare', they are merged
    3.49 + *  into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
    3.50 + *  TLB, reschedule and local APIC vectors are performance-critical.
    3.51 + *
    3.52 + *  Vectors 0xf0-0xf9 are free (reserved for future Linux use).
    3.53 + */
    3.54 +#define SPURIOUS_APIC_VECTOR	0xff
    3.55 +#define ERROR_APIC_VECTOR	0xfe
    3.56 +#define INVALIDATE_TLB_VECTOR	0xfd
    3.57 +#define RESCHEDULE_VECTOR	0xfc
    3.58 +#define TASK_MIGRATION_VECTOR	0xfb
    3.59 +#define CALL_FUNCTION_VECTOR	0xfa
    3.60 +#define KDB_VECTOR	0xf9
    3.61 +
    3.62 +#define THERMAL_APIC_VECTOR	0xf0
    3.63 +
    3.64 +
    3.65 +/*
    3.66 + * Local APIC timer IRQ vector is on a different priority level,
    3.67 + * to work around the 'lost local interrupt if more than 2 IRQ
    3.68 + * sources per level' errata.
    3.69 + */
    3.70 +#define LOCAL_TIMER_VECTOR	0xef
    3.71 +
    3.72 +/*
    3.73 + * First APIC vector available to drivers: (vectors 0x30-0xee)
    3.74 + * we start at 0x31 to spread out vectors evenly between priority
    3.75 + * levels. (0x80 is the syscall vector)
    3.76 + */
    3.77 +#define FIRST_DEVICE_VECTOR	0x31
    3.78 +#define FIRST_SYSTEM_VECTOR	0xef   /* duplicated in irq.h */
    3.79 +
    3.80 +
    3.81 +#ifndef __ASSEMBLY__
    3.82 +extern u8 irq_vector[NR_IRQ_VECTORS];
    3.83 +#define IO_APIC_VECTOR(irq)	(irq_vector[irq])
    3.84 +#define AUTO_ASSIGN		-1
    3.85 +
    3.86 +/*
    3.87 + * Various low-level irq details needed by irq.c, process.c,
    3.88 + * time.c, io_apic.c and smp.c
    3.89 + *
    3.90 + * Interrupt entry/exit code at both C and assembly level
    3.91 + */
    3.92 +
    3.93 +extern void disable_8259A_irq(unsigned int irq);
    3.94 +extern void enable_8259A_irq(unsigned int irq);
    3.95 +extern int i8259A_irq_pending(unsigned int irq);
    3.96 +extern void make_8259A_irq(unsigned int irq);
    3.97 +extern void init_8259A(int aeoi);
    3.98 +extern void FASTCALL(send_IPI_self(int vector));
    3.99 +extern void init_VISWS_APIC_irqs(void);
   3.100 +extern void setup_IO_APIC(void);
   3.101 +extern void disable_IO_APIC(void);
   3.102 +extern void print_IO_APIC(void);
   3.103 +extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
   3.104 +extern void send_IPI(int dest, int vector);
   3.105 +extern void setup_ioapic_dest(void);
   3.106 +
   3.107 +extern unsigned long io_apic_irqs;
   3.108 +
   3.109 +extern atomic_t irq_err_count;
   3.110 +extern atomic_t irq_mis_count;
   3.111 +
   3.112 +#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
   3.113 +
   3.114 +#define __STR(x) #x
   3.115 +#define STR(x) __STR(x)
   3.116 +
   3.117 +#include <asm/ptrace.h>
   3.118 +
   3.119 +#define IRQ_NAME2(nr) nr##_interrupt(void)
   3.120 +#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
   3.121 +
   3.122 +/*
   3.123 + *	SMP has a few special interrupts for IPI messages
   3.124 + */
   3.125 +
   3.126 +#define BUILD_IRQ(nr) \
   3.127 +asmlinkage void IRQ_NAME(nr); \
   3.128 +__asm__( \
   3.129 +"\n.p2align\n" \
   3.130 +"IRQ" #nr "_interrupt:\n\t" \
   3.131 +	"push $" #nr "-256 ; " \
   3.132 +	"jmp common_interrupt");
   3.133 +
   3.134 +extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i);
   3.135 +
   3.136 +#define platform_legacy_irq(irq)	((irq) < 16)
   3.137 +
   3.138 +#endif
   3.139 +
   3.140 +#endif /* _ASM_HW_IRQ_H */