From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755523AbbFLJul (ORCPT ); Fri, 12 Jun 2015 05:50:41 -0400 Received: from [198.137.202.10] ([198.137.202.10]:34780 "EHLO terminus.zytor.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755454AbbFLJuf (ORCPT ); Fri, 12 Jun 2015 05:50:35 -0400 Date: Fri, 12 Jun 2015 02:50:05 -0700 From: tip-bot for Feng Wu Message-ID: Cc: mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, feng.wu@intel.com, David.Woodhouse@intel.com, jiang.liu@linux.intel.com, joro@8bytes.org, hpa@zytor.com Reply-To: jiang.liu@linux.intel.com, David.Woodhouse@intel.com, joro@8bytes.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, feng.wu@intel.com, linux-kernel@vger.kernel.org In-Reply-To: <1433827237-3382-7-git-send-email-feng.wu@intel.com> References: <1433827237-3382-7-git-send-email-feng.wu@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] iommu, x86: Avoid migrating VT-d posted interrupts Git-Commit-ID: d75f152fc389cdd73a6c17f1247fce9052fd579c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d75f152fc389cdd73a6c17f1247fce9052fd579c Gitweb: http://git.kernel.org/tip/d75f152fc389cdd73a6c17f1247fce9052fd579c Author: Feng Wu AuthorDate: Tue, 9 Jun 2015 13:20:33 +0800 Committer: Thomas Gleixner CommitDate: Fri, 12 Jun 2015 11:33:52 +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 as this would overwrite the posted mode entry. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu Reviewed-by: Thomas Gleixner Acked-by: David Woodhouse Acked-by: Joerg Roedel 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 --- 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