From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Hiding pci devices from dom0 drivers Date: Mon, 24 Sep 2007 09:13:17 +0100 Message-ID: <1190621597.22768.1.camel@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain 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: Keir Fraser Cc: "You, Yongkang" , "Han, Weidong" , xen-devel@lists.xensource.com, "Kay, Allen M" List-Id: xen-devel@lists.xenproject.org On Mon, 2007-09-24 at 08:27 +0100, Keir Fraser wrote: > On 24/9/07 08:10, "Kay, Allen M" wrote: > > > Currently we had to manually make the following change in linux config > > before building dom0 kernel to enable pciback.hide functionality in > > dom0. > > > > -CONFIG_XEN_PCIDEV_BACKEND=m > > +CONFIG_XEN_PCIDEV_BACKEND=y > > > > What do you think about having this change check into your tree so that > > we can get rid of this manual step? If you are ok with it, we can send > > you a patch for it. > > It's already '=y' in the -xen0 kernel. -xen is a modular kernel config to > keep the base kernel a reasonable size. PCI device hiding is still an > esoteric option that most users will not use. You can also get the same effect as pciback.hide entirely from userspace: # cat pciback #!/bin/sh if [ $# -eq 0 ] ; then echo "Require a PCI device as parameter" exit 1 fi for pcidev in $@ ; do if [ -h /sys/bus/pci/devices/"$pcidev"/driver ] ; then echo "Unbinding $pcidev from" $(basename $(readlink /sys/bus/pci/devices/"$pcidev"/driver)) echo -n "$pcidev" > /sys/bus/pci/devices/"$pcidev"/driver/unbind fi echo "Binding $pcidev to pciback" echo -n "$pcidev" > /sys/bus/pci/drivers/pciback/new_slot echo -n "$pcidev" > /sys/bus/pci/drivers/pciback/bind done