VT-d: posted interrupts require interrupt remapping
diff mbox series

Message ID 5CA6FD5D0200007800224C46@prv1-mh.provo.novell.com
State New, archived
Headers show
Series
  • VT-d: posted interrupts require interrupt remapping
Related show

Commit Message

Jan Beulich April 5, 2019, 7:01 a.m. UTC
Initially I had just noticed the unnecessary indirection in the call
from pi_update_irte(). The generic wrapper having an iommu_intremap
conditional made me look at the setup code though. So first of all
enforce the necessary dependency.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Tian, Kevin April 9, 2019, 3:09 a.m. UTC | #1
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: Friday, April 5, 2019 3:02 PM
> 
> Initially I had just noticed the unnecessary indirection in the call
> from pi_update_irte(). The generic wrapper having an iommu_intremap
> conditional made me look at the setup code though. So first of all
> enforce the necessary dependency.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Kevin Tian <kevin.tian@intel.com>
Andrew Cooper April 9, 2019, 9:10 a.m. UTC | #2
On 05/04/2019 08:01, Jan Beulich wrote:
> Initially I had just noticed the unnecessary indirection in the call
> from pi_update_irte(). The generic wrapper having an iommu_intremap
> conditional made me look at the setup code though. So first of all
> enforce the necessary dependency.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Patch
diff mbox series

--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -993,7 +993,8 @@  int pi_update_irte(const struct pi_desc
     spin_unlock_irq(&desc->lock);
 
     ASSERT(pcidevs_locked());
-    return iommu_update_ire_from_msi(msi_desc, &msi_desc->msg);
+
+    return msi_msg_write_remap_rte(msi_desc, &msi_desc->msg);
 
  unlock_out:
     spin_unlock_irq(&desc->lock);
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2342,7 +2342,7 @@  static int __init vtd_setup(void)
          * not supported, since we count on this feature to
          * atomically update 16-byte IRTE in posted format.
          */
-        if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 )
+        if ( !cap_intr_post(iommu->cap) || !iommu_intremap || !cpu_has_cx16 )
             iommu_intpost = 0;
 
         if ( !vtd_ept_page_compatible(iommu) )