iommu, x86: Avoid migrating VT-d posted interrupts
authorFeng Wu <feng.wu@intel.com>
Tue, 9 Jun 2015 05:20:33 +0000 (13:20 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 12 Jun 2015 09:33:52 +0000 (11:33 +0200)
When the interrupt is configured in posted mode, the destination of
the interrupt is set in the Posted-Interrupts Descriptor and the
migration of these interrupts happens during vCPU scheduling.

We still update the cached irte, which will be used when changing back
to remapping mode, but we avoid writing the table entry as this would
overwrite the posted mode entry.

Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Cc: dwmw2@infradead.org
Link: http://lkml.kernel.org/r/1433827237-3382-7-git-send-email-feng.wu@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/iommu/intel_irq_remapping.c

index 68bce0a..3bcb459 100644 (file)
@@ -1003,7 +1003,10 @@ intel_ir_set_affinity(struct irq_data *data, const struct cpumask *mask,
         */
        irte->vector = cfg->vector;
        irte->dest_id = IRTE_DEST(cfg->dest_apicid);
-       modify_irte(&ir_data->irq_2_iommu, irte);
+
+       /* Update the hardware only if the interrupt is in remapped mode. */
+       if (ir_data->irq_2_iommu.mode == IRQ_REMAPPING)
+               modify_irte(&ir_data->irq_2_iommu, irte);
 
        /*
         * After this point, all the interrupts will start arriving