[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 15/16] xen/vtd: prevent from assign the device with shared rmrr
 
- To: Tamas K Lengyel <tamas.k.lengyel@xxxxxxxxx>
 
- From: "Chen, Tiejun" <tiejun.chen@xxxxxxxxx>
 
- Date: Sun, 6 Sep 2015 12:19:49 +0800
 
- Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx,	Wei Liu <wei.liu2@xxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>,	George Dunlap <George.Dunlap@xxxxxxxxxxxxx>,	Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>,	Yang Zhang <yang.z.zhang@xxxxxxxxx>
 
- Delivery-date: Sun, 06 Sep 2015 04:20:17 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
 
 
 
On 9/6/2015 11:19 AM, Tamas K Lengyel wrote:
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c
b/xen/drivers/passthrough/vtd/iommu.c
index 836aed5..038776a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2310,12 +2310,16 @@ static int intel_iommu_assign_device(
              PCI_DEVFN2(bdf) == devfn &&
              rmrr->scope.devices_cnt > 1 )
         {
+            u32 relaxed = flag & XEN_DOMCTL_DEV_RDM_RELAXED;
+
             printk(XENLOG_G_ERR VTDPREFIX
-                   " cannot assign %04x:%02x:%02x.%u"
+                   " Currently its %s to assign %04x:%02x:%02x.%u"
                    " with shared RMRR at %"PRIx64" for Dom%d.\n",
+                   relaxed ? "disallowed" : "risky",
 
This debug message is backwards?
 
 
Yeah. Its indeed like this, relaxed ? "risky" : "disallowed"
But lets wait Jan's comment to step next.
 
 
                    seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
                    rmrr->base_address, d->domain_id);
-            return -EPERM;
+            if ( !relaxed )
+                return -EPERM;
         }
     }
Tamas, do you actually mean to assign these to _different_
guests, considering the log fragment above?)
 
 
No, I actually want to assign them to the same domain. The domain creation
fails with either of those devices specified for passthrough whether they
are to be attached to the same domain or not.
 
 
Tamas, could you try this in your case?
 
 
Took me a while to find the xl config option to set this flag (pci = [
'sbdf, rdm_policy=strict/relaxed' ]) but now it works as expected!
 
 
 I remember 'relaxed' is a default value so 'rdm_policy' can't be dropped 
here if you like this.
Thanks
Tiejun
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
    
     |