]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
passthrough/io: fall back to remapping interrupt when we can't use VT-d PI
authorChao Gao <chao.gao@intel.com>
Fri, 7 Apr 2017 13:38:40 +0000 (15:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Apr 2017 13:38:40 +0000 (15:38 +0200)
The current logic of using VT-d pi is when guest configurates the pirq's
destination vcpu to a single vcpu, the according IRTE is updated to
posted format. If the destination of the pirq is multiple vcpus, we will
stay in posted format. Obviously, we should fall back to remapping interrupt
when guest wrongly configurate destination of pirq or makes it have
multi-destination vcpus.

Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
[jb: guard against vcpu being NULL]
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/io.c

index 3e0a10e2c66801f313ee7dcc9408102af3452f59..e5a43e508f4d10dfc317fa7ef55f5fe98ece13c4 100644 (file)
@@ -413,15 +413,8 @@ int pt_irq_create_bind(
 
         /* Use interrupt posting if it is supported. */
         if ( iommu_intpost )
-        {
-            if ( vcpu )
-                pi_update_irte(&vcpu->arch.hvm_vmx.pi_desc, info,
-                               pirq_dpci->gmsi.gvec);
-            else
-                dprintk(XENLOG_G_INFO,
-                        "%pv: deliver interrupt in remapping mode,gvec:%02x\n",
-                        vcpu, pirq_dpci->gmsi.gvec);
-        }
+            pi_update_irte(vcpu ? &vcpu->arch.hvm_vmx.pi_desc : NULL,
+                           info, pirq_dpci->gmsi.gvec);
 
         break;
     }