Mailing List Archive

main_pcilist_assignable
Hi Stefano,

I found xl allows me to passthrough PCI devices to guests even when I did not hide them to either pciback or pci-stub (xm has this check).

Libxl has main_pcilist_assignable() that seems suppose to do something similar but I'm having trouble finding the callers.

Can you tell me which code calls this function?

Allen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: main_pcilist_assignable [ In reply to ]
On Sat, 26 Feb 2011, Kay, Allen M wrote:
> Hi Stefano,
>
> I found xl allows me to passthrough PCI devices to guests even when I did not hide them to either pciback or pci-stub (xm has this check).
>
> Libxl has main_pcilist_assignable() that seems suppose to do something similar but I'm having trouble finding the callers.
>
> Can you tell me which code calls this function?

main_pcilist_assignable is called when the user executes

xl pci-list-assignable-devices

the function main_pcilist_assignable is in the cmd_table
(tools/libxl/xl_cmdtable.c).
In any case main_pcilist_assignable is just a wrapper around
libxl_device_pci_list_assignable, that contains the interesting
implementation details.
libxl_device_pci_list_assignable is only called by
main_pcilist_assignable, but it could be called before actually doing
any device assignement, for example in xl_cmdimpl.c:pciattach.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: main_pcilist_assignable [ In reply to ]
Stefano,

I found libxl missing many of the checking we had in xm python code when we passthrough pci devices to the guest.

Attached patch makes sure the passthrough device belongs to pciback before allow them passthrough to the guest. There are still many other checks missing.

Xm terminates the guest startup process when this type of condition is found. This patch just allows the guest to continue to boot but with no device passthrough. I tried to call exit() by the guest windows still hangs around. Is there an example code for calling exit that also closes the guest (QEMU VGA) window?

Allen

-----Original Message-----
From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com]
Sent: Monday, February 28, 2011 3:14 AM
To: Kay, Allen M
Cc: Stefano Stabellini; xen-devel@lists.xensource.com
Subject: Re: main_pcilist_assignable

On Sat, 26 Feb 2011, Kay, Allen M wrote:
> Hi Stefano,
>
> I found xl allows me to passthrough PCI devices to guests even when I did not hide them to either pciback or pci-stub (xm has this check).
>
> Libxl has main_pcilist_assignable() that seems suppose to do something similar but I'm having trouble finding the callers.
>
> Can you tell me which code calls this function?

main_pcilist_assignable is called when the user executes

xl pci-list-assignable-devices

the function main_pcilist_assignable is in the cmd_table
(tools/libxl/xl_cmdtable.c).
In any case main_pcilist_assignable is just a wrapper around
libxl_device_pci_list_assignable, that contains the interesting
implementation details.
libxl_device_pci_list_assignable is only called by
main_pcilist_assignable, but it could be called before actually doing
any device assignement, for example in xl_cmdimpl.c:pciattach.
RE: main_pcilist_assignable [ In reply to ]
On Wed, 2 Mar 2011, Kay, Allen M wrote:
> Stefano,
>
> I found libxl missing many of the checking we had in xm python code when we passthrough pci devices to the guest.
>
> Attached patch makes sure the passthrough device belongs to pciback before allow them passthrough to the guest. There are still many other checks missing.
>

Thanks for the patch!

> Xm terminates the guest startup process when this type of condition is found. This patch just allows the guest to continue to boot but with no device passthrough. I tried to call exit() by the guest windows still hangs around. Is there an example code for calling exit that also closes the guest (QEMU VGA) window?
>

libxl__device_pci_add needs to propagate the error to the callers and the
callers (do_domain_create and pciattach) need to handle it correctly.
In particular do_domain_create would have to goto error_out.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: main_pcilist_assignable [ In reply to ]
Kay, Allen M writes ("[Xen-devel] RE: main_pcilist_assignable"):
> Attached patch makes sure the passthrough device belongs to pciback
> before allow them passthrough to the guest. There are still many
> other checks missing.

Thanks for the patch. I see Stefano has already replied with some
comments. We are now in code freeze and it may be better to leave
this until 4.2 ?

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Re: RE: main_pcilist_assignable [ In reply to ]
On Thu, 2011-03-03 at 17:10 +0000, Ian Jackson wrote:
> Kay, Allen M writes ("[Xen-devel] RE: main_pcilist_assignable"):
> > Attached patch makes sure the passthrough device belongs to pciback
> > before allow them passthrough to the guest. There are still many
> > other checks missing.
>
> Thanks for the patch. I see Stefano has already replied with some
> comments. We are now in code freeze and it may be better to leave
> this until 4.2 ?

FWIW, I wrote original faulty code and ack this as an obvious bug-fix.

Gianni


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
RE: RE: main_pcilist_assignable [ In reply to ]
Ian,

Looks like the attach libxl patch is still not in the latest staging tree. Gianni has already acked it in the email below. Here is the patch description and sign off line in case you need it:

---

This patch checks to make sure the passthrough PCI device is owned by pciback driver.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>



-----Original Message-----
From: Gianni Tedesco [mailto:gianni.tedesco@citrix.com]
Sent: Thursday, March 03, 2011 9:22 AM
To: Ian Jackson
Cc: Kay, Allen M; xen-devel@lists.xensource.com; Stefano Stabellini
Subject: Re: [Xen-devel] RE: main_pcilist_assignable

On Thu, 2011-03-03 at 17:10 +0000, Ian Jackson wrote:
> Kay, Allen M writes ("[Xen-devel] RE: main_pcilist_assignable"):
> > Attached patch makes sure the passthrough device belongs to pciback
> > before allow them passthrough to the guest. There are still many
> > other checks missing.
>
> Thanks for the patch. I see Stefano has already replied with some
> comments. We are now in code freeze and it may be better to leave
> this until 4.2 ?

FWIW, I wrote original faulty code and ack this as an obvious bug-fix.

Gianni
RE: RE: main_pcilist_assignable [ In reply to ]
Kay, Allen M writes ("RE: [Xen-devel] RE: main_pcilist_assignable"):
> Looks like the attach libxl patch is still not in the latest staging tree. Gianni has already acked it in the email below. Here is the patch description and sign off line in case you need it:

Sorry, yes, thanks. I did need those and I have now applied the
patch. Hopefully it will make it into 4.1.0 RC7 and thus the release.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel