[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Hiding PCI devices with modprobe.d



On 17/06/2013 22:04, Daniel Shub wrote:
I have now tried a number of different solutions for hiding the PCI devices, 
but nothing is working completely. The simplest conceptually is David's 
suggestion to load the xen-pciback module in the initrd. This guarantees that 
the xen-pciback module gets loaded before any other modules have a chance to 
bind the devices. This works nearly flawlessly, except for an issue with my 
Intel integrated sound card that I am trying to hide. I am having the identical 
problem as was discussed at 
http://lists.xen.org/archives/html/xen-users/2013-05/msg00283.html where I need 
to allow the dom0 to bind the sound card and load the kernel modules before 
hiding it, otherwise I get noise and choppy playback in the domU. This means 
Ian's suggestion of recompiling the kernel and and hiding the devices with grub 
will likely not be any better.

I then tried to hide the devices later since this would allow the dom0 to bind 
the sound card. This is was basically a modification of Gordan's suggestion 
where I unbind devices with a modprobe.d conf file since. My conf file is

   install xen-pciback /root/pcidetach.sh; insmod /lib/modules/$(/bin/uname 
-r)/kernel/drivers/xen/xen-pciback/xen-pciback.ko.gz

where I tried a number of different things in pcidetach.sh. The problem I kept 
running into is that I am running pcidetach.sh before loading the xen-pciback 
module which means I cannot hide anything. i should say that Gordan's actual 
suggestion probably would not run into this problem since he suggested 
providing the configuration to prevent other modules from binding the devices.

Did you notice (or did I omit it...) that the first thing pcidetach.sh does is modprobe xen-pciback?

I finally tried hiding the devices even later by creating a systemd udev service

   [Unit]
   Description=PCI hide

   [Service]
   Type=oneshot
   ExecStart=/bin/bash /root/pcihide.sh

   [Install]
   WantedBy=multi-user.target

where pcihide.sh uses the xl toolstack to hide the devices. This works, except 
it runs after the domUs in /etc/xen/auto get started. I could obviously add the 
start up of the domUs into pcihide.sh, but seems like a real hack.

My plan is to go back to hiding the devices in the initrd where I load 
explicitly load snd-intel-hda and then xen-pciback. I would need to create a 
modprobe.d conf file that can handle unbinding the sound card similar to 
Gordan's orginal suggestion. It is a little harder since I need to let it get 
bound and then unbound before loading xen-pciback. I am still open to any 
suggestions.

I guess the reason it works for me (I also use Intel ICH audio) is because I don't auto-start my VMs. I always start mine manually.

Gordan

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.