[tip:x86/apic] iommu, x86: Avoid migrating VT-d posted interrupts

From: tip-bot for Feng Wu
Date: Mon Jun 08 2015 - 09:45:10 EST


Commit-ID: ad2453cb74dd0e1ba201b449b610557dc7434234
Gitweb: http://git.kernel.org/tip/ad2453cb74dd0e1ba201b449b610557dc7434234
Author: Feng Wu <feng.wu@xxxxxxxxx>
AuthorDate: Fri, 5 Jun 2015 13:42:50 +0800
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Mon, 8 Jun 2015 15:41:32 +0200

iommu, x86: Avoid migrating VT-d posted interrupts

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.

Signed-off-by: Feng Wu <feng.wu@xxxxxxxxx>
Reviewed-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
Acked-by: David Woodhouse <David.Woodhouse@xxxxxxxxx>
Acked-by: Joerg Roedel <joro@xxxxxxxxxx>
Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: dwmw2@xxxxxxxxxxxxx
Link: http://lkml.kernel.org/r/1433482974-14614-6-git-send-email-feng.wu@xxxxxxxxx
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
drivers/iommu/intel_irq_remapping.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 68bce0a..3bcb459 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/