ia64/xen-unstable
changeset 18552:5274aa966231
vtd: Fix check for interrupt remapping of ioapic RTE
For IOAPIC interrupt remapping, it only needs to remap ioapci RTE,
should not remap other IOAPIC registers, which are IOAPIC ID, VERSION
and Arbitration ID. This patch adds the check for this and only remap
ioapci RTE.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
For IOAPIC interrupt remapping, it only needs to remap ioapci RTE,
should not remap other IOAPIC registers, which are IOAPIC ID, VERSION
and Arbitration ID. This patch adds the check for this and only remap
ioapci RTE.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Sep 26 11:12:29 2008 +0100 (2008-09-26) |
parents | b642e39d96cf |
children | 08374be21318 |
files | xen/include/asm-x86/io_apic.h |
line diff
1.1 --- a/xen/include/asm-x86/io_apic.h Thu Sep 25 17:41:29 2008 +0100 1.2 +++ b/xen/include/asm-x86/io_apic.h Fri Sep 26 11:12:29 2008 +0100 1.3 @@ -123,9 +123,12 @@ extern struct mpc_config_intsrc mp_irqs[ 1.4 /* non-0 if default (table-less) MP configuration */ 1.5 extern int mpc_default_type; 1.6 1.7 +/* Only need to remap ioapic RTE (reg: 10~3Fh) */ 1.8 +#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10)) 1.9 + 1.10 static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 1.11 { 1.12 - if (iommu_enabled) 1.13 + if (ioapic_reg_remapped(reg)) 1.14 return io_apic_read_remap_rte(apic, reg); 1.15 *IO_APIC_BASE(apic) = reg; 1.16 return *(IO_APIC_BASE(apic)+4); 1.17 @@ -133,7 +136,7 @@ static inline unsigned int io_apic_read( 1.18 1.19 static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) 1.20 { 1.21 - if (iommu_enabled) 1.22 + if (ioapic_reg_remapped(reg)) 1.23 return iommu_update_ire_from_apic(apic, reg, value); 1.24 *IO_APIC_BASE(apic) = reg; 1.25 *(IO_APIC_BASE(apic)+4) = value; 1.26 @@ -152,7 +155,7 @@ extern int sis_apic_bug; 1.27 #endif 1.28 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) 1.29 { 1.30 - if (iommu_enabled) 1.31 + if (ioapic_reg_remapped(reg)) 1.32 return iommu_update_ire_from_apic(apic, reg, value); 1.33 if (sis_apic_bug) 1.34 *IO_APIC_BASE(apic) = reg;