[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vtd: Fix check for interrupt remapping of ioapic RTE



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222423949 -3600
# Node ID 5274aa966231ad5f050987e1fb00c6f6ee75a007
# Parent  b642e39d96cf62731c37d29fdf2dea9fe512e3e9
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@xxxxxxxxx>
Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/include/asm-x86/io_apic.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff -r b642e39d96cf -r 5274aa966231 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h     Thu Sep 25 17:41:29 2008 +0100
+++ b/xen/include/asm-x86/io_apic.h     Fri Sep 26 11:12:29 2008 +0100
@@ -123,9 +123,12 @@ extern struct mpc_config_intsrc mp_irqs[
 /* non-0 if default (table-less) MP configuration */
 extern int mpc_default_type;
 
+/* Only need to remap ioapic RTE (reg: 10~3Fh) */
+#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10))
+
 static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
 {
-       if (iommu_enabled)
+       if (ioapic_reg_remapped(reg))
                return io_apic_read_remap_rte(apic, reg);
        *IO_APIC_BASE(apic) = reg;
        return *(IO_APIC_BASE(apic)+4);
@@ -133,7 +136,7 @@ static inline unsigned int io_apic_read(
 
 static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned 
int value)
 {
-       if (iommu_enabled)
+       if (ioapic_reg_remapped(reg))
                return iommu_update_ire_from_apic(apic, reg, value);
        *IO_APIC_BASE(apic) = reg;
        *(IO_APIC_BASE(apic)+4) = value;
@@ -152,7 +155,7 @@ extern int sis_apic_bug;
 #endif
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, 
unsigned int value)
 {
-       if (iommu_enabled)
+       if (ioapic_reg_remapped(reg))
                return iommu_update_ire_from_apic(apic, reg, value);
        if (sis_apic_bug)
                *IO_APIC_BASE(apic) = reg;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.