Skip to content

Commit

Permalink
x86: Embedd irq_2_iommu into irq_cfg
Browse files Browse the repository at this point in the history
That interrupt remapping code is x86 specific and tied to the io_apic
code. No need for separate allocator functions in the interrupt
remapping code. This allows to simplify the code and irq_2_iommu is
small (13 bytes on 64bit) so it's not a real problem even if interrupt
remapping is runtime disabled. If it's compile time disabled the
impact is zero.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Thomas Gleixner committed Oct 12, 2010
1 parent d0ad639 commit 423f085
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 10 additions & 0 deletions arch/x86/include/asm/hw_irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
irq_attr->polarity = polarity;
}

struct irq_2_iommu {
struct intel_iommu *iommu;
u16 irte_index;
u16 sub_handle;
u8 irte_mask;
};

/*
* This is performance-critical, we want to do it O(1)
*
Expand All @@ -89,6 +96,9 @@ struct irq_cfg {
cpumask_var_t old_domain;
u8 vector;
u8 move_in_progress : 1;
#ifdef CONFIG_INTR_REMAP
struct irq_2_iommu irq_2_iommu;
#endif
};

extern struct irq_cfg *irq_cfg(unsigned int);
Expand Down
7 changes: 0 additions & 7 deletions drivers/pci/intr_remapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ static __init int setup_intremap(char *str)
}
early_param("intremap", setup_intremap);

struct irq_2_iommu {
struct intel_iommu *iommu;
u16 irte_index;
u16 sub_handle;
u8 irte_mask;
};

#ifdef CONFIG_GENERIC_HARDIRQS
static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
{
Expand Down
1 change: 1 addition & 0 deletions include/linux/dmar.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct irte {
__u64 high;
};
};

#ifdef CONFIG_INTR_REMAP
extern int intr_remapping_enabled;
extern int intr_remapping_supported(void);
Expand Down

0 comments on commit 423f085

Please sign in to comment.