From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: FLR support in xl tool stack Date: Fri, 28 Jan 2011 07:34:06 +0000 Message-ID: <1296200046.20804.74.camel@localhost.localdomain> References: <987664A83D2D224EAE907B061CE93D53019438F9F8@orsmsx505.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jean Guyader Cc: xen-devel , Stefano Stabellini , Wilk , "Kay, Allen M" , Jean Guyader , Thomas Horsten , Ross Philipson List-Id: xen-devel@lists.xenproject.org On Fri, 2011-01-28 at 04:20 +0000, Jean Guyader wrote: > On 28 January 2011 08:38, Kay, Allen M wrote: > > In xm tool stack, there is a function called do_FLR() located in > python/xen/util/pci.py that takes care of issuing FLR to passthrough > PCI devices. This function is responsible for looking at the device > and figure out the most appropriate way to reset the device (PCI/PCIe > FLR, secondary bus reset, etc...). > > > > In xl tool stack, I see there is a libxl_device_pci_reset() in > libxl/libxl_pci.c that suppose to do the similar thing. It > references /sys/bus/pci/drivers/pciback/do_flr and tries to write > something to it. However, pciback driver in 2.6.32.27 pvops kernel > does not seem to have this do_flr functionality. > > > > Is this something being worked on but not checked in to pvops dom0 > kernel yet? > > > > If not, I would prefer implementing all of the do_FLR() > functionaility in libxl and not to depend on pciback driver given it > is not part of the upstream kernel. This will make using newer > kernels such as 2.6.38 much easier. > > > > Comments? > > > > On the newest kernels (I don't know from which version), the reset > function has been moved under the pci device tree directly. So > /sys/bus/pci/device//reset. Only... ^s ... otherwise that's correct and libxl will try this path if the pciback one does not exist. If any additional FLR functionality is required it should be done in the kernel as part of this generic FLR mechanism so that everyone benefits. drivers/pci/pci-sysfs.c provides the sysfs node based on the result of pci_probe_reset_function(dev) which tries a bunch of generic ways of resetting a device. In addition drivers/pci/quirks.c provides some device specific quirks. Perhaps all that is needed is to nominate some patches for backporting to the xen/stable-2.6.32 branch? $ git log --no-merges --pretty=oneline v2.6.32.27..origin/master drivers/pci/quirks.c seems to provide an initial set of potentially interesting candidates. Ian.