From: Sander Eikelenboom Subject: Xen pci-passthrough problem with pci-detach and pci-assignable-remove Date: Fri, 10 Jan 2014 15:51:57 +0100 Message-ID: <1447395332.20140110155157@eikelenboom.it> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W1dRK-00046V-G5 for xen-devel@lists.xenproject.org; Fri, 10 Jan 2014 14:52:02 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Hi Konrad, Normally i'm never reattaching pci devices to dom0, but at the moment i have some use for it. But it seems pci-detach isn't completely detaching the device from the guest. - Say i have a guest (HVM) with domid=2 and a pci device passedthrough with bdf 00:19.0, the device is hidden on boot with xen-pciback.hide=(00:19.0) in grub. - Now i do a "xl pci-assignable-list" This returns nothing, which is correct since all hidden devices have already been assigned to guests. - Then i do "xl -v pci-detach 2 00:19.0" Which also returns nothing ... - Now i do a "xl pci-assignable-list" again .. This returns: "0000:00:19.0" So the pci-detach does seem to have done *something* :-) - But when now trying to remove the device from pciback to dom0 with "xl pci-assignable-remove 00:19.0" it gives an error and later it give some stacktraces .. xen_pciback: ****** removing device 0000:00:19.0 while still in-use! ****** xen_pciback: ****** driver domain may still access this device's i/o resources! xen_pciback: ****** shutdown driver domain before binding device xen_pciback: ****** to other drivers of domains When i shut the guest down instead of using pci-detach, the "xl pci-assignable-remove" works fine and i can rebind the device to it's driver in dom0. So am i misreading the wiki .. and is it not possible to detach a device from a running domain or ... ? Oh yes running xen-unstable and a 3.13-rc7 kernel -- Sander