[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417592394-24343-7-git-send-email-feng.wu@intel.com>
Date: Wed, 3 Dec 2014 15:39:35 +0800
From: Feng Wu <feng.wu@...el.com>
To: tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, gleb@...nel.org, pbonzini@...hat.com,
dwmw2@...radead.org, joro@...tes.org, alex.williamson@...hat.com,
jiang.liu@...ux.intel.com
Cc: linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
kvm@...r.kernel.org, Feng Wu <feng.wu@...el.com>
Subject: [v2 06/25] iommu, x86: No need to migrating irq for VT-d Posted-Interrupts
We don't need to migrate the irqs for VT-d Posted-Interrupts here.
When 'pst' is set in IRTE, the associated irq will be posted to
guests instead of interrupt remapping. The destination of the
interrupt is set in Posted-Interrupts Descriptor, and the migration
happens during vCPU scheduling.
Signed-off-by: Feng Wu <feng.wu@...el.com>
Reviewed-by: Jiang Liu <jiang.liu@...ux.intel.com>
---
drivers/iommu/intel_irq_remapping.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 749cb93..01786a8 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -976,10 +976,20 @@ intel_ir_set_affinity(struct irq_data *data, const struct cpumask *mask,
{
struct intel_ir_data *ir_data = data->chip_data;
struct irte *irte = &ir_data->irte_entry;
+ struct irte_pi *irte_pi = (struct irte_pi *)irte;
struct irq_cfg *cfg = irqd_cfg(data);
struct irq_data *parent = data->parent_data;
int ret;
+ /*
+ * If the interrupt is for posting, it is used by guests,
+ * we cannot set irq affinity here.
+ */
+ if (irte_pi->pst == 1) {
+ pr_warn("cannot set irq affinity for posted-interrupts\n");
+ return -EBUSY;
+ }
+
ret = parent->chip->irq_set_affinity(parent, mask, force);
if (ret < 0 || ret == IRQ_SET_MASK_OK_DONE)
return ret;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists