Skip to contentSkip to conversation

VM creation failure using passthrough with latest unstable

DISCUSSION Ross Philipson 2 participants 3 messages Jul 22, 2008 – Jul 23, 2008

lore
Share & tools
lore
#0 lore raw

I have pulled a recent (today's) clone of staging/xen-unstable.hg and I get a failure when trying to create a domain with xend/xm. The failure I get is:

Error: ('<domain GUID>', 'VM_metrics')

I have traced the problem down to where the pci = [ '02:00.0' ] parameter (which is the value in my case) from my configuration file is being tested in xc.c:pyxc_test_assign_device(). This function fails and causes the calling code in xm/create.py:make_domain() to fail. The attached log shows the output where this fails - the wrong values for the bus/dev/func are clearly being traced out.

Something changed in the last 2 - 3 weeks to cause this. I do not see this issue with a July 2 pull of unstable. I will keep digging but I hoped something would ring a bell.

Thanks

Ross

Ross Philipson

Senior Software Engineer

Citrix Systems, Inc

14 Crosby Drive

Bedford, MA 01730

781-301-7949

[email protected] <mailto:[email protected]>

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

RE: VM creation failure using passthrough with latestunstable

Quoted 3 lines

File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2094, in _constructDomain
raise VmError("Fail to assign device(%x:%x.%x): maybe VT-d is "
VmError: Fail to assign device(ff:1f.7): maybe VT-d is not enabled, or the device is not exist, or it has already been assigned to other domain

According to the log (actually bdf = -1 here), I believe it's due to the recent changeset:

7 days ago: iommu: disable by default. 'iommu' on cmdline to enable.
changeset 18057: b5bfe3515f65
http://xenbits.xensource.com/xen-unstable.hg?rev/b5bfe3515f65 <http://xenbits.xensource.com/xen-unstable.hg?rev/b5bfe3515f65>

Now you need to specify "iommu=1" in the Xen grub entry to assign iommu devices.

I think the error message "Error: (‘<domain GUID>’, ‘VM_metrics’)" is confusing... We'd better improve it.

Thanks,
-- Dexuan

________________________________

From: [email protected] [mailto:[email protected]] On Behalf Of Ross Philipson
Sent: 2008年7月23日 1:54
To: [email protected]
Subject: [Xen-devel] VM creation failure using passthrough with latestunstable

I have pulled a recent (today’s) clone of staging/xen-unstable.hg and I get a failure when trying to create a domain with xend/xm. The failure I get is:

Error: (‘<domain GUID>’, ‘VM_metrics’)

I have traced the problem down to where the pci = [ ’02:00.0’ ] parameter (which is the value in my case) from my configuration file is being tested in xc.c:pyxc_test_assign_device(). This function fails and causes the calling code in xm/create.py:make_domain() to fail. The attached log shows the output where this fails – the wrong values for the bus/dev/func are clearly being traced out.

Something changed in the last 2 – 3 weeks to cause this. I do not see this issue with a July 2 pull of unstable. I will keep digging but I hoped something would ring a bell.

Thanks

Ross

Ross Philipson

Senior Software Engineer

Citrix Systems, Inc

14 Crosby Drive

Bedford, MA 01730

781-301-7949

[email protected] <mailto:[email protected]>

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

RE: VM creation failure using passthrough with latestunstable

Thanks, that was certainly the problem. The error messages are misleading as is the xend log trace. The bdf value returned is -1 which is why the trace output shows incorrect PCI information. The attached patch e.g. might not be the prettiest output but it would be correct.

From: Cui, Dexuan [mailto:[email protected]]
Sent: Tuesday, July 22, 2008 10:10 PM
To: Ross Philipson; [email protected]
Subject: RE: [Xen-devel] VM creation failure using passthrough with latestunstable

Quoted 3 lines

File "//usr/lib/python/xen/xend/XendDomainInfo.py", line 2094, in _constructDomain
raise VmError("Fail to assign device(%x:%x.%x): maybe VT-d is "
VmError: Fail to assign device(ff:1f.7): maybe VT-d is not enabled, or the device is not exist, or it has already been assigned to other domain

According to the log (actually bdf = -1 here), I believe it's due to the recent changeset:

7 days ago: iommu: disable by default. 'iommu' on cmdline to enable.
changeset 18057: b5bfe3515f65
http://xenbits.xensource.com/xen-unstable.hg?rev/b5bfe3515f65 <http://xenbits.xensource.com/xen-unstable.hg?rev/b5bfe3515f65>

Now you need to specify "iommu=1" in the Xen grub entry to assign iommu devices.

I think the error message "Error: (‘<domain GUID>’, ‘VM_metrics’)" is confusing... We'd better improve it.

Thanks,
-- Dexuan

________________________________

From: [email protected] [mailto:[email protected]] On Behalf Of Ross Philipson
Sent: 2008年7月23日 1:54
To: [email protected]
Subject: [Xen-devel] VM creation failure using passthrough with latestunstable

I have pulled a recent (today’s) clone of staging/xen-unstable.hg and I get a failure when trying to create a domain with xend/xm. The failure I get is:

Error: (‘<domain GUID>’, ‘VM_metrics’)

I have traced the problem down to where the pci = [ ’02:00.0’ ] parameter (which is the value in my case) from my configuration file is being tested in xc.c:pyxc_test_assign_device(). This function fails and causes the calling code in xm/create.py:make_domain() to fail. The attached log shows the output where this fails - the wrong values for the bus/dev/func are clearly being traced out.

Something changed in the last 2 - 3 weeks to cause this. I do not see this issue with a July 2 pull of unstable. I will keep digging but I hoped something would ring a bell.

Thanks

Ross

Ross Philipson

Senior Software Engineer

Citrix Systems, Inc

14 Crosby Drive

Bedford, MA 01730

781-301-7949

[email protected]

tools/python/xen/xend/XendDomainInfo.py +2 -2
diff -Nur a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
@@ -2090,10 +2090,10 @@
                 devfn = (bdf >> 8) & 0xff
                 dev = (devfn >> 3) & 0x1f
                 func = devfn & 0x7
-                raise VmError("Fail to assign device(%x:%x.%x): maybe VT-d is "
+                raise VmError("Fail to assign device %s: maybe VT-d is "
                               "not enabled, or the device is not exist, or it "
                               "has already been assigned to other domain"
-                              % (bus, dev, func))
+                              % (pci_str))
 
         # register the domain in the list 
         from xen.xend import XendDomain

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel