x86, iommu/vt-d: Clean up interfaces for interrupt remapping

Remove the Intel specific interfaces from dmar.h and remove
asm/irq_remapping.h which is only used for io_apic.c anyway.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
Joerg Roedel 2012-03-30 11:47:06 -07:00
parent 5e2b930b07
commit 263b5e8629
4 changed files with 26 additions and 92 deletions

View File

@ -1,22 +0,0 @@
#ifndef _ASM_X86_IRQ_REMAPPING_H
#define _ASM_X86_IRQ_REMAPPING_H
#define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8)
#ifdef CONFIG_IRQ_REMAP
static void irq_remap_modify_chip_defaults(struct irq_chip *chip);
static inline bool irq_remapped(struct irq_cfg *cfg)
{
return cfg->irq_2_iommu.iommu != NULL;
}
#else
static inline bool irq_remapped(struct irq_cfg *cfg)
{
return false;
}
static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
{
}
#endif
#endif /* _ASM_X86_IRQ_REMAPPING_H */

View File

@ -58,7 +58,6 @@
#include <asm/hypertransport.h> #include <asm/hypertransport.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/intr_remapping.h> #include <asm/intr_remapping.h>
#include <asm/irq_remapping.h>
#include <asm/hpet.h> #include <asm/hpet.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
@ -87,6 +86,22 @@ void __init set_io_apic_ops(const struct io_apic_ops *ops)
io_apic_ops = *ops; io_apic_ops = *ops;
} }
#ifdef CONFIG_IRQ_REMAP
static void irq_remap_modify_chip_defaults(struct irq_chip *chip);
static inline bool irq_remapped(struct irq_cfg *cfg)
{
return cfg->irq_2_iommu.iommu != NULL;
}
#else
static inline bool irq_remapped(struct irq_cfg *cfg)
{
return false;
}
static inline void irq_remap_modify_chip_defaults(struct irq_chip *chip)
{
}
#endif
/* /*
* Is the SiS APIC rmw bug present ? * Is the SiS APIC rmw bug present ?
* -1 = don't know, 0 = no, 1 = yes * -1 = don't know, 0 = no, 1 = yes

View File

@ -64,7 +64,7 @@ int get_irte(int irq, struct irte *entry)
return 0; return 0;
} }
int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) static int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
{ {
struct ir_table *table = iommu->ir_table; struct ir_table *table = iommu->ir_table;
struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); struct irq_2_iommu *irq_iommu = irq_2_iommu(irq);
@ -136,7 +136,7 @@ static int qi_flush_iec(struct intel_iommu *iommu, int index, int mask)
return qi_submit_sync(&desc, iommu); return qi_submit_sync(&desc, iommu);
} }
int map_irq_to_irte_handle(int irq, u16 *sub_handle) static int map_irq_to_irte_handle(int irq, u16 *sub_handle)
{ {
struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); struct irq_2_iommu *irq_iommu = irq_2_iommu(irq);
unsigned long flags; unsigned long flags;
@ -152,7 +152,7 @@ int map_irq_to_irte_handle(int irq, u16 *sub_handle)
return index; return index;
} }
int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) static int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
{ {
struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); struct irq_2_iommu *irq_iommu = irq_2_iommu(irq);
unsigned long flags; unsigned long flags;
@ -172,7 +172,7 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
return 0; return 0;
} }
int modify_irte(int irq, struct irte *irte_modified) static int modify_irte(int irq, struct irte *irte_modified)
{ {
struct irq_2_iommu *irq_iommu = irq_2_iommu(irq); struct irq_2_iommu *irq_iommu = irq_2_iommu(irq);
struct intel_iommu *iommu; struct intel_iommu *iommu;
@ -200,7 +200,7 @@ int modify_irte(int irq, struct irte *irte_modified)
return rc; return rc;
} }
struct intel_iommu *map_hpet_to_ir(u8 hpet_id) static struct intel_iommu *map_hpet_to_ir(u8 hpet_id)
{ {
int i; int i;
@ -210,7 +210,7 @@ struct intel_iommu *map_hpet_to_ir(u8 hpet_id)
return NULL; return NULL;
} }
struct intel_iommu *map_ioapic_to_ir(int apic) static struct intel_iommu *map_ioapic_to_ir(int apic)
{ {
int i; int i;
@ -220,7 +220,7 @@ struct intel_iommu *map_ioapic_to_ir(int apic)
return NULL; return NULL;
} }
struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) static struct intel_iommu *map_dev_to_ir(struct pci_dev *dev)
{ {
struct dmar_drhd_unit *drhd; struct dmar_drhd_unit *drhd;
@ -312,7 +312,7 @@ static void set_irte_sid(struct irte *irte, unsigned int svt,
irte->sid = sid; irte->sid = sid;
} }
int set_ioapic_sid(struct irte *irte, int apic) static int set_ioapic_sid(struct irte *irte, int apic)
{ {
int i; int i;
u16 sid = 0; u16 sid = 0;
@ -337,7 +337,7 @@ int set_ioapic_sid(struct irte *irte, int apic)
return 0; return 0;
} }
int set_hpet_sid(struct irte *irte, u8 id) static int set_hpet_sid(struct irte *irte, u8 id)
{ {
int i; int i;
u16 sid = 0; u16 sid = 0;
@ -367,7 +367,7 @@ int set_hpet_sid(struct irte *irte, u8 id)
return 0; return 0;
} }
int set_msi_sid(struct irte *irte, struct pci_dev *dev) static int set_msi_sid(struct irte *irte, struct pci_dev *dev)
{ {
struct pci_dev *bridge; struct pci_dev *bridge;

View File

@ -114,65 +114,6 @@ struct irte {
}; };
}; };
#ifdef CONFIG_IRQ_REMAP
extern int get_irte(int irq, struct irte *entry);
extern int modify_irte(int irq, struct irte *irte_modified);
extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count);
extern int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index,
u16 sub_handle);
extern int map_irq_to_irte_handle(int irq, u16 *sub_handle);
extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
extern struct intel_iommu *map_ioapic_to_ir(int apic);
extern struct intel_iommu *map_hpet_to_ir(u8 id);
extern int set_ioapic_sid(struct irte *irte, int apic);
extern int set_hpet_sid(struct irte *irte, u8 id);
extern int set_msi_sid(struct irte *irte, struct pci_dev *dev);
#else
static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
{
return -1;
}
static inline int modify_irte(int irq, struct irte *irte_modified)
{
return -1;
}
static inline int map_irq_to_irte_handle(int irq, u16 *sub_handle)
{
return -1;
}
static inline int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index,
u16 sub_handle)
{
return -1;
}
static inline struct intel_iommu *map_dev_to_ir(struct pci_dev *dev)
{
return NULL;
}
static inline struct intel_iommu *map_ioapic_to_ir(int apic)
{
return NULL;
}
static inline struct intel_iommu *map_hpet_to_ir(unsigned int hpet_id)
{
return NULL;
}
static inline int set_ioapic_sid(struct irte *irte, int apic)
{
return 0;
}
static inline int set_hpet_sid(struct irte *irte, u8 id)
{
return -1;
}
static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
{
return 0;
}
#endif
enum { enum {
IRQ_REMAP_XAPIC_MODE, IRQ_REMAP_XAPIC_MODE,
IRQ_REMAP_X2APIC_MODE, IRQ_REMAP_X2APIC_MODE,