2008-10-23 05:26:29 +00:00
|
|
|
#ifndef _ASM_X86_HW_IRQ_H
|
|
|
|
#define _ASM_X86_HW_IRQ_H
|
2008-05-02 17:00:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
|
|
|
|
*
|
|
|
|
* moved some of the old arch/i386/kernel/irq.h to here. VY
|
|
|
|
*
|
|
|
|
* IRQ/IPI changes taken from work by Thomas Radke
|
|
|
|
* <tomsoft@informatik.tu-chemnitz.de>
|
|
|
|
*
|
|
|
|
* hacked by Andi Kleen for x86-64.
|
|
|
|
* unified by tglx
|
|
|
|
*/
|
|
|
|
|
2008-05-02 18:10:09 +00:00
|
|
|
#include <asm/irq_vectors.h>
|
2008-05-02 17:00:30 +00:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
#include <linux/percpu.h>
|
|
|
|
#include <linux/profile.h>
|
|
|
|
#include <linux/smp.h>
|
|
|
|
|
2011-07-26 23:09:06 +00:00
|
|
|
#include <linux/atomic.h>
|
2008-05-02 17:00:30 +00:00
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/sections.h>
|
|
|
|
|
|
|
|
/* Interrupt handlers registered during init_IRQ */
|
2013-08-05 22:02:37 +00:00
|
|
|
extern asmlinkage void apic_timer_interrupt(void);
|
|
|
|
extern asmlinkage void x86_platform_ipi(void);
|
|
|
|
extern asmlinkage void kvm_posted_intr_ipi(void);
|
|
|
|
extern asmlinkage void error_interrupt(void);
|
|
|
|
extern asmlinkage void irq_work_interrupt(void);
|
|
|
|
|
|
|
|
extern asmlinkage void spurious_interrupt(void);
|
|
|
|
extern asmlinkage void thermal_interrupt(void);
|
|
|
|
extern asmlinkage void reschedule_interrupt(void);
|
|
|
|
|
|
|
|
extern asmlinkage void invalidate_interrupt(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt0(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt1(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt2(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt3(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt4(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt5(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt6(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt7(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt8(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt9(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt10(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt11(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt12(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt13(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt14(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt15(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt16(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt17(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt18(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt19(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt20(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt21(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt22(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt23(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt24(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt25(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt26(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt27(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt28(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt29(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt30(void);
|
|
|
|
extern asmlinkage void invalidate_interrupt31(void);
|
|
|
|
|
|
|
|
extern asmlinkage void irq_move_cleanup_interrupt(void);
|
|
|
|
extern asmlinkage void reboot_interrupt(void);
|
|
|
|
extern asmlinkage void threshold_interrupt(void);
|
|
|
|
|
|
|
|
extern asmlinkage void call_function_interrupt(void);
|
|
|
|
extern asmlinkage void call_function_single_interrupt(void);
|
2008-05-02 17:00:30 +00:00
|
|
|
|
x86, trace: Add irq vector tracepoints
[Purpose of this patch]
As Vaibhav explained in the thread below, tracepoints for irq vectors
are useful.
http://www.spinics.net/lists/mm-commits/msg85707.html
<snip>
The current interrupt traces from irq_handler_entry and irq_handler_exit
provide when an interrupt is handled. They provide good data about when
the system has switched to kernel space and how it affects the currently
running processes.
There are some IRQ vectors which trigger the system into kernel space,
which are not handled in generic IRQ handlers. Tracing such events gives
us the information about IRQ interaction with other system events.
The trace also tells where the system is spending its time. We want to
know which cores are handling interrupts and how they are affecting other
processes in the system. Also, the trace provides information about when
the cores are idle and which interrupts are changing that state.
<snip>
On the other hand, my usecase is tracing just local timer event and
getting a value of instruction pointer.
I suggested to add an argument local timer event to get instruction pointer before.
But there is another way to get it with external module like systemtap.
So, I don't need to add any argument to irq vector tracepoints now.
[Patch Description]
Vaibhav's patch shared a trace point ,irq_vector_entry/irq_vector_exit, in all events.
But there is an above use case to trace specific irq_vector rather than tracing all events.
In this case, we are concerned about overhead due to unwanted events.
So, add following tracepoints instead of introducing irq_vector_entry/exit.
so that we can enable them independently.
- local_timer_vector
- reschedule_vector
- call_function_vector
- call_function_single_vector
- irq_work_entry_vector
- error_apic_vector
- thermal_apic_vector
- threshold_apic_vector
- spurious_apic_vector
- x86_platform_ipi_vector
Also, introduce a logic switching IDT at enabling/disabling time so that a time penalty
makes a zero when tracepoints are disabled. Detailed explanations are as follows.
- Create trace irq handlers with entering_irq()/exiting_irq().
- Create a new IDT, trace_idt_table, at boot time by adding a logic to
_set_gate(). It is just a copy of original idt table.
- Register the new handlers for tracpoints to the new IDT by introducing
macros to alloc_intr_gate() called at registering time of irq_vector handlers.
- Add checking, whether irq vector tracing is on/off, into load_current_idt().
This has to be done below debug checking for these reasons.
- Switching to debug IDT may be kicked while tracing is enabled.
- On the other hands, switching to trace IDT is kicked only when debugging
is disabled.
In addition, the new IDT is created only when CONFIG_TRACING is enabled to avoid being
used for other purposes.
Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Link: http://lkml.kernel.org/r/51C323ED.5050708@hds.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
2013-06-20 15:46:53 +00:00
|
|
|
#ifdef CONFIG_TRACING
|
|
|
|
/* Interrupt handlers registered during init_IRQ */
|
|
|
|
extern void trace_apic_timer_interrupt(void);
|
|
|
|
extern void trace_x86_platform_ipi(void);
|
|
|
|
extern void trace_error_interrupt(void);
|
|
|
|
extern void trace_irq_work_interrupt(void);
|
|
|
|
extern void trace_spurious_interrupt(void);
|
|
|
|
extern void trace_thermal_interrupt(void);
|
|
|
|
extern void trace_reschedule_interrupt(void);
|
|
|
|
extern void trace_threshold_interrupt(void);
|
|
|
|
extern void trace_call_function_interrupt(void);
|
|
|
|
extern void trace_call_function_single_interrupt(void);
|
|
|
|
#define trace_irq_move_cleanup_interrupt irq_move_cleanup_interrupt
|
|
|
|
#define trace_reboot_interrupt reboot_interrupt
|
|
|
|
#define trace_kvm_posted_intr_ipi kvm_posted_intr_ipi
|
|
|
|
#endif /* CONFIG_TRACING */
|
|
|
|
|
2014-10-27 08:11:56 +00:00
|
|
|
#ifdef CONFIG_IRQ_REMAP
|
2012-09-26 10:44:44 +00:00
|
|
|
/* Intel specific interrupt remapping information */
|
2010-10-10 09:39:09 +00:00
|
|
|
struct irq_2_iommu {
|
|
|
|
struct intel_iommu *iommu;
|
|
|
|
u16 irte_index;
|
|
|
|
u16 sub_handle;
|
|
|
|
u8 irte_mask;
|
|
|
|
};
|
|
|
|
|
2012-09-26 10:44:44 +00:00
|
|
|
/* AMD specific interrupt remapping information */
|
|
|
|
struct irq_2_irte {
|
|
|
|
u16 devid; /* Device ID for IRTE table */
|
|
|
|
u16 index; /* Index into IRTE table*/
|
|
|
|
};
|
2014-10-27 08:11:56 +00:00
|
|
|
#endif /* CONFIG_IRQ_REMAP */
|
2012-09-26 10:44:44 +00:00
|
|
|
|
2015-04-13 06:11:35 +00:00
|
|
|
struct irq_domain;
|
|
|
|
|
2014-10-27 08:11:56 +00:00
|
|
|
#ifdef CONFIG_X86_LOCAL_APIC
|
2014-10-27 08:12:00 +00:00
|
|
|
struct irq_data;
|
irq_remapping: Introduce new interfaces to support hierarchical irqdomains
Introduce new interfaces for interrupt remapping drivers to support
hierarchical irqdomains:
1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an
interrupt remapping unit. IOAPIC/HPET drivers use this interface to
get parent interrupt remapping irqdomain.
2) irq_remapping_get_irq_domain(): get irqdomain for an IRQ allocation.
This is mainly used to support MSI irqdomain. We must build one MSI
irqdomain for each interrupt remapping unit. MSI driver calls this
interface to get MSI irqdomain associated with an IR irqdomain which
manages the PCI devices. In a further step we will store the irqdomain
pointer in the device struct to avoid this call in the irq allocation
path.
Architecture specific hooks:
1) arch_get_ir_parent_domain(): get parent irqdomain for IR irqdomain,
which is x86_vector_domain on x86 platforms.
2) arch_create_msi_irq_domain(): create an MSI irqdomain associated with
the interrupt remapping unit.
We also add following callbacks into struct irq_remap_ops:
struct irq_domain *(*get_ir_irq_domain)(struct irq_alloc_info *);
struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
Once all clients of IR have been converted to the new hierarchical irqdomain
interfaces, we will:
1) Remove set_ioapic_entry, set_affinity, free_irq, compose_msi_msg,
msi_alloc_irq, msi_setup_irq, setup_hpet_msi from struct remap_osp
2) Remove setup_ioapic_remapped_entry, free_remapped_irq,
compose_remapped_msi_msg, setup_hpet_msi_remapped, setup_remapped_irq.
3) Simplify x86_io_apic_ops and x86_msi.
We can achieve a way clearer architecture with all these changes
applied.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428905519-23704-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-04-13 06:11:30 +00:00
|
|
|
struct pci_dev;
|
|
|
|
struct msi_desc;
|
|
|
|
|
|
|
|
enum irq_alloc_type {
|
|
|
|
X86_IRQ_ALLOC_TYPE_IOAPIC = 1,
|
|
|
|
X86_IRQ_ALLOC_TYPE_HPET,
|
|
|
|
X86_IRQ_ALLOC_TYPE_MSI,
|
|
|
|
X86_IRQ_ALLOC_TYPE_MSIX,
|
2015-04-13 06:11:42 +00:00
|
|
|
X86_IRQ_ALLOC_TYPE_DMAR,
|
irq_remapping: Introduce new interfaces to support hierarchical irqdomains
Introduce new interfaces for interrupt remapping drivers to support
hierarchical irqdomains:
1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an
interrupt remapping unit. IOAPIC/HPET drivers use this interface to
get parent interrupt remapping irqdomain.
2) irq_remapping_get_irq_domain(): get irqdomain for an IRQ allocation.
This is mainly used to support MSI irqdomain. We must build one MSI
irqdomain for each interrupt remapping unit. MSI driver calls this
interface to get MSI irqdomain associated with an IR irqdomain which
manages the PCI devices. In a further step we will store the irqdomain
pointer in the device struct to avoid this call in the irq allocation
path.
Architecture specific hooks:
1) arch_get_ir_parent_domain(): get parent irqdomain for IR irqdomain,
which is x86_vector_domain on x86 platforms.
2) arch_create_msi_irq_domain(): create an MSI irqdomain associated with
the interrupt remapping unit.
We also add following callbacks into struct irq_remap_ops:
struct irq_domain *(*get_ir_irq_domain)(struct irq_alloc_info *);
struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
Once all clients of IR have been converted to the new hierarchical irqdomain
interfaces, we will:
1) Remove set_ioapic_entry, set_affinity, free_irq, compose_msi_msg,
msi_alloc_irq, msi_setup_irq, setup_hpet_msi from struct remap_osp
2) Remove setup_ioapic_remapped_entry, free_remapped_irq,
compose_remapped_msi_msg, setup_hpet_msi_remapped, setup_remapped_irq.
3) Simplify x86_io_apic_ops and x86_msi.
We can achieve a way clearer architecture with all these changes
applied.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428905519-23704-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-04-13 06:11:30 +00:00
|
|
|
};
|
2015-04-13 06:11:24 +00:00
|
|
|
|
|
|
|
struct irq_alloc_info {
|
irq_remapping: Introduce new interfaces to support hierarchical irqdomains
Introduce new interfaces for interrupt remapping drivers to support
hierarchical irqdomains:
1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an
interrupt remapping unit. IOAPIC/HPET drivers use this interface to
get parent interrupt remapping irqdomain.
2) irq_remapping_get_irq_domain(): get irqdomain for an IRQ allocation.
This is mainly used to support MSI irqdomain. We must build one MSI
irqdomain for each interrupt remapping unit. MSI driver calls this
interface to get MSI irqdomain associated with an IR irqdomain which
manages the PCI devices. In a further step we will store the irqdomain
pointer in the device struct to avoid this call in the irq allocation
path.
Architecture specific hooks:
1) arch_get_ir_parent_domain(): get parent irqdomain for IR irqdomain,
which is x86_vector_domain on x86 platforms.
2) arch_create_msi_irq_domain(): create an MSI irqdomain associated with
the interrupt remapping unit.
We also add following callbacks into struct irq_remap_ops:
struct irq_domain *(*get_ir_irq_domain)(struct irq_alloc_info *);
struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
Once all clients of IR have been converted to the new hierarchical irqdomain
interfaces, we will:
1) Remove set_ioapic_entry, set_affinity, free_irq, compose_msi_msg,
msi_alloc_irq, msi_setup_irq, setup_hpet_msi from struct remap_osp
2) Remove setup_ioapic_remapped_entry, free_remapped_irq,
compose_remapped_msi_msg, setup_hpet_msi_remapped, setup_remapped_irq.
3) Simplify x86_io_apic_ops and x86_msi.
We can achieve a way clearer architecture with all these changes
applied.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428905519-23704-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-04-13 06:11:30 +00:00
|
|
|
enum irq_alloc_type type;
|
2015-04-13 06:11:24 +00:00
|
|
|
u32 flags;
|
|
|
|
const struct cpumask *mask; /* CPU mask for vector allocation */
|
irq_remapping: Introduce new interfaces to support hierarchical irqdomains
Introduce new interfaces for interrupt remapping drivers to support
hierarchical irqdomains:
1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an
interrupt remapping unit. IOAPIC/HPET drivers use this interface to
get parent interrupt remapping irqdomain.
2) irq_remapping_get_irq_domain(): get irqdomain for an IRQ allocation.
This is mainly used to support MSI irqdomain. We must build one MSI
irqdomain for each interrupt remapping unit. MSI driver calls this
interface to get MSI irqdomain associated with an IR irqdomain which
manages the PCI devices. In a further step we will store the irqdomain
pointer in the device struct to avoid this call in the irq allocation
path.
Architecture specific hooks:
1) arch_get_ir_parent_domain(): get parent irqdomain for IR irqdomain,
which is x86_vector_domain on x86 platforms.
2) arch_create_msi_irq_domain(): create an MSI irqdomain associated with
the interrupt remapping unit.
We also add following callbacks into struct irq_remap_ops:
struct irq_domain *(*get_ir_irq_domain)(struct irq_alloc_info *);
struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
Once all clients of IR have been converted to the new hierarchical irqdomain
interfaces, we will:
1) Remove set_ioapic_entry, set_affinity, free_irq, compose_msi_msg,
msi_alloc_irq, msi_setup_irq, setup_hpet_msi from struct remap_osp
2) Remove setup_ioapic_remapped_entry, free_remapped_irq,
compose_remapped_msi_msg, setup_hpet_msi_remapped, setup_remapped_irq.
3) Simplify x86_io_apic_ops and x86_msi.
We can achieve a way clearer architecture with all these changes
applied.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428905519-23704-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-04-13 06:11:30 +00:00
|
|
|
union {
|
|
|
|
int unused;
|
|
|
|
#ifdef CONFIG_HPET_TIMER
|
|
|
|
struct {
|
|
|
|
int hpet_id;
|
|
|
|
int hpet_index;
|
|
|
|
void *hpet_data;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_PCI_MSI
|
|
|
|
struct {
|
|
|
|
struct pci_dev *msi_dev;
|
|
|
|
irq_hw_number_t msi_hwirq;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_X86_IO_APIC
|
|
|
|
struct {
|
|
|
|
int ioapic_id;
|
|
|
|
int ioapic_pin;
|
|
|
|
int ioapic_node;
|
|
|
|
u32 ioapic_trigger : 1;
|
|
|
|
u32 ioapic_polarity : 1;
|
|
|
|
u32 ioapic_valid : 1;
|
|
|
|
struct IO_APIC_route_entry *ioapic_entry;
|
|
|
|
};
|
2015-04-13 06:11:42 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_DMAR_TABLE
|
|
|
|
struct {
|
|
|
|
int dmar_id;
|
|
|
|
void *dmar_data;
|
|
|
|
};
|
2015-04-13 06:11:43 +00:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_HT_IRQ
|
|
|
|
struct {
|
|
|
|
int ht_pos;
|
|
|
|
int ht_idx;
|
|
|
|
struct pci_dev *ht_dev;
|
|
|
|
void *ht_update;
|
|
|
|
};
|
irq_remapping: Introduce new interfaces to support hierarchical irqdomains
Introduce new interfaces for interrupt remapping drivers to support
hierarchical irqdomains:
1) irq_remapping_get_ir_irq_domain(): get irqdomain associated with an
interrupt remapping unit. IOAPIC/HPET drivers use this interface to
get parent interrupt remapping irqdomain.
2) irq_remapping_get_irq_domain(): get irqdomain for an IRQ allocation.
This is mainly used to support MSI irqdomain. We must build one MSI
irqdomain for each interrupt remapping unit. MSI driver calls this
interface to get MSI irqdomain associated with an IR irqdomain which
manages the PCI devices. In a further step we will store the irqdomain
pointer in the device struct to avoid this call in the irq allocation
path.
Architecture specific hooks:
1) arch_get_ir_parent_domain(): get parent irqdomain for IR irqdomain,
which is x86_vector_domain on x86 platforms.
2) arch_create_msi_irq_domain(): create an MSI irqdomain associated with
the interrupt remapping unit.
We also add following callbacks into struct irq_remap_ops:
struct irq_domain *(*get_ir_irq_domain)(struct irq_alloc_info *);
struct irq_domain *(*get_irq_domain)(struct irq_alloc_info *);
Once all clients of IR have been converted to the new hierarchical irqdomain
interfaces, we will:
1) Remove set_ioapic_entry, set_affinity, free_irq, compose_msi_msg,
msi_alloc_irq, msi_setup_irq, setup_hpet_msi from struct remap_osp
2) Remove setup_ioapic_remapped_entry, free_remapped_irq,
compose_remapped_msi_msg, setup_hpet_msi_remapped, setup_remapped_irq.
3) Simplify x86_io_apic_ops and x86_msi.
We can achieve a way clearer architecture with all these changes
applied.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Acked-by: Joerg Roedel <jroedel@suse.de>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: iommu@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Joerg Roedel <joro@8bytes.org>
Link: http://lkml.kernel.org/r/1428905519-23704-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-04-13 06:11:30 +00:00
|
|
|
#endif
|
|
|
|
};
|
2015-04-13 06:11:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
/* Allocate contiguous CPU vectors */
|
|
|
|
X86_IRQ_ALLOC_CONTIGUOUS_VECTORS = 0x1,
|
|
|
|
};
|
2014-10-27 08:12:00 +00:00
|
|
|
|
2009-10-13 20:32:36 +00:00
|
|
|
struct irq_cfg {
|
|
|
|
cpumask_var_t domain;
|
|
|
|
cpumask_var_t old_domain;
|
2015-04-13 06:11:23 +00:00
|
|
|
unsigned int dest_apicid;
|
2009-10-13 20:32:36 +00:00
|
|
|
u8 vector;
|
|
|
|
u8 move_in_progress : 1;
|
2011-08-24 00:05:25 +00:00
|
|
|
#ifdef CONFIG_IRQ_REMAP
|
2012-09-26 10:44:45 +00:00
|
|
|
u8 remapped : 1;
|
2012-09-26 10:44:44 +00:00
|
|
|
union {
|
|
|
|
struct irq_2_iommu irq_2_iommu;
|
|
|
|
struct irq_2_irte irq_2_irte;
|
|
|
|
};
|
2010-10-10 09:39:09 +00:00
|
|
|
#endif
|
2014-10-27 08:11:56 +00:00
|
|
|
union {
|
|
|
|
#ifdef CONFIG_X86_IO_APIC
|
|
|
|
struct {
|
|
|
|
struct list_head irq_2_pin;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
};
|
2009-10-13 20:32:36 +00:00
|
|
|
};
|
|
|
|
|
2015-04-13 06:11:24 +00:00
|
|
|
extern struct irq_domain *x86_vector_domain;
|
|
|
|
|
|
|
|
extern void init_irq_alloc_info(struct irq_alloc_info *info,
|
|
|
|
const struct cpumask *mask);
|
|
|
|
extern void copy_irq_alloc_info(struct irq_alloc_info *dst,
|
|
|
|
struct irq_alloc_info *src);
|
2014-10-27 08:11:59 +00:00
|
|
|
extern struct irq_cfg *irq_cfg(unsigned int irq);
|
|
|
|
extern struct irq_cfg *irqd_cfg(struct irq_data *irq_data);
|
2014-10-27 08:12:00 +00:00
|
|
|
extern struct irq_cfg *alloc_irq_and_cfg_at(unsigned int at, int node);
|
|
|
|
extern void lock_vector_lock(void);
|
|
|
|
extern void unlock_vector_lock(void);
|
2009-10-13 20:32:36 +00:00
|
|
|
extern int assign_irq_vector(int, struct irq_cfg *, const struct cpumask *);
|
2014-10-27 08:12:00 +00:00
|
|
|
extern void clear_irq_vector(int irq, struct irq_cfg *cfg);
|
|
|
|
extern void setup_vector_irq(int cpu);
|
2014-10-27 08:12:11 +00:00
|
|
|
#ifdef CONFIG_SMP
|
2009-10-13 20:32:36 +00:00
|
|
|
extern void send_cleanup_vector(struct irq_cfg *);
|
2014-11-05 09:12:27 +00:00
|
|
|
extern void irq_complete_move(struct irq_cfg *cfg);
|
2014-10-27 08:12:11 +00:00
|
|
|
#else
|
|
|
|
static inline void send_cleanup_vector(struct irq_cfg *c) { }
|
2014-11-05 09:12:27 +00:00
|
|
|
static inline void irq_complete_move(struct irq_cfg *c) { }
|
2014-10-27 08:12:11 +00:00
|
|
|
#endif
|
2009-10-14 13:06:42 +00:00
|
|
|
|
2014-10-27 08:12:00 +00:00
|
|
|
extern int apic_retrigger_irq(struct irq_data *data);
|
|
|
|
extern void apic_ack_edge(struct irq_data *data);
|
|
|
|
extern int apic_set_affinity(struct irq_data *data, const struct cpumask *mask,
|
|
|
|
unsigned int *dest_id);
|
|
|
|
#else /* CONFIG_X86_LOCAL_APIC */
|
2014-10-27 08:11:56 +00:00
|
|
|
static inline void lock_vector_lock(void) {}
|
|
|
|
static inline void unlock_vector_lock(void) {}
|
2014-10-27 08:12:00 +00:00
|
|
|
#endif /* CONFIG_X86_LOCAL_APIC */
|
2014-10-27 08:11:56 +00:00
|
|
|
|
2015-04-13 06:11:35 +00:00
|
|
|
#ifdef CONFIG_PCI_MSI
|
|
|
|
extern void arch_init_msi_domain(struct irq_domain *domain);
|
|
|
|
#else
|
|
|
|
static inline void arch_init_msi_domain(struct irq_domain *domain) { }
|
|
|
|
#endif
|
2015-04-13 06:11:43 +00:00
|
|
|
#ifdef CONFIG_HT_IRQ
|
|
|
|
extern void arch_init_htirq_domain(struct irq_domain *domain);
|
|
|
|
#else
|
|
|
|
static inline void arch_init_htirq_domain(struct irq_domain *domain) { }
|
|
|
|
#endif
|
2015-04-13 06:11:35 +00:00
|
|
|
|
2008-05-02 17:00:30 +00:00
|
|
|
/* Statistics */
|
|
|
|
extern atomic_t irq_err_count;
|
|
|
|
extern atomic_t irq_mis_count;
|
|
|
|
|
2008-05-02 22:30:50 +00:00
|
|
|
/* EISA */
|
|
|
|
extern void eisa_set_level_irq(unsigned int irq);
|
|
|
|
|
2008-07-23 11:43:14 +00:00
|
|
|
/* SMP */
|
2013-08-05 22:02:37 +00:00
|
|
|
extern __visible void smp_apic_timer_interrupt(struct pt_regs *);
|
|
|
|
extern __visible void smp_spurious_interrupt(struct pt_regs *);
|
|
|
|
extern __visible void smp_x86_platform_ipi(struct pt_regs *);
|
|
|
|
extern __visible void smp_error_interrupt(struct pt_regs *);
|
2009-04-10 18:33:10 +00:00
|
|
|
#ifdef CONFIG_X86_IO_APIC
|
|
|
|
extern asmlinkage void smp_irq_move_cleanup_interrupt(void);
|
|
|
|
#endif
|
2009-01-27 16:07:08 +00:00
|
|
|
#ifdef CONFIG_SMP
|
2013-08-05 22:02:37 +00:00
|
|
|
extern __visible void smp_reschedule_interrupt(struct pt_regs *);
|
|
|
|
extern __visible void smp_call_function_interrupt(struct pt_regs *);
|
|
|
|
extern __visible void smp_call_function_single_interrupt(struct pt_regs *);
|
|
|
|
extern __visible void smp_invalidate_interrupt(struct pt_regs *);
|
2008-07-25 05:12:26 +00:00
|
|
|
#endif
|
2008-07-23 11:43:14 +00:00
|
|
|
|
2015-04-03 19:49:13 +00:00
|
|
|
extern char irq_entries_start[];
|
2013-10-30 20:37:00 +00:00
|
|
|
#ifdef CONFIG_TRACING
|
2015-04-03 19:49:13 +00:00
|
|
|
#define trace_irq_entries_start irq_entries_start
|
2013-10-30 20:37:00 +00:00
|
|
|
#endif
|
2008-08-20 03:50:28 +00:00
|
|
|
|
2014-04-02 12:13:47 +00:00
|
|
|
#define VECTOR_UNDEFINED (-1)
|
|
|
|
#define VECTOR_RETRIGGERED (-2)
|
2014-01-05 16:10:52 +00:00
|
|
|
|
2008-05-02 20:10:39 +00:00
|
|
|
typedef int vector_irq_t[NR_VECTORS];
|
|
|
|
DECLARE_PER_CPU(vector_irq_t, vector_irq);
|
2008-05-02 17:00:30 +00:00
|
|
|
|
2008-05-02 20:10:39 +00:00
|
|
|
#endif /* !ASSEMBLY_ */
|
|
|
|
|
2008-10-23 05:26:29 +00:00
|
|
|
#endif /* _ASM_X86_HW_IRQ_H */
|