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

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



On Mon, 17 Jun 2013 08:59:53 -0500, David Sutton <kantras@xxxxxxxxx> wrote:
Daniel,

On Mon, Jun 17, 2013 at 5:25 AM, Daniel Shub  wrote:

I am running Xen 4.2 with the XL toolstack on Arch Linux. I have a set
of PCI devices that I am trying to hide. From the command line I can
hide the devices with

Â

ÂÂÂ # xl pci-assignable-add 01:00.0

ÂÂÂ # xl pci-assignable-add 01:00.1

ÂÂÂ # xl pci-assignable-add 02:00.0

ÂÂÂ # xl pci-assignable-add 03:00.0

Â

and confirm they are hidden with

Â

ÂÂÂ # xl pci-assignable-list

Â

I wanted to automate this so I created a file called
/etc/modprobe.d/pcihide.conf and included

Â

 ÂÂoptions xen-pciback hide=(01:00.0)(01.00.1)(02:00.0)(03:00.0)

Â

When I reboot only some of the devices are hidden. Looking in dmesg
and xl dmesg I can see entries for the devices that are successfully
hidden, but no obvious entries for the devices that are not hidden. If
I remove the /etc/modprobe.d/pcihide.conf file and reboot, no devices
are hidden, so the file is getting loaded and I am able to hide some
devices with this method.

Â

I am unable to hide a built in SATA controller, two built in USB 2.0
controllers, two built in USB 3.0 controllers, and an add on SATA card
with the modprobe.d file. I am able to hide two add on video
cards(with HDMI audio) and a TV tuner card with the modprobe.d file. I
can hide all the devices with xl pci-assignable-add.

Â

Is using a Âmodprobe.d file the right way to hide PCI devices on
boot? If so, I know this isnât a lot to work with, but where should
I be looking for information about what is going wrong?

I'm also using Arch Linux, with xen-4.2.2. The way I tackled this
problem is moved the loading of xen-pciback into the initrd, so that
it would load before any of the other modules. In order to do this,
edit your /etc/mkinitcpio.conf and make the following changes:

* Add 'xen-pciback' into the MODULES array. This will make sure that
the module is included in the initrd.

* Add 'modconf' into the 'HOOKS' array . This will make sure that all
the files in /etc/modprobe.d/ get included in the initrd.

The only other thing I did was use the same name as the module for my
modprobe.d file:

$ cat /etc/modprobe.d/xen-pciback.conf
options xen-pciback
hide=(0000:06:00.1)(0000:06:00.0)(0000:00:12.2)(0000:00:12.0)

That is a reasonably neat solution, but it does come with the drawback
that you have to rebuild your initrd every time you need to change
the devices you need to pass through. Granted, though, that
probably won't happen much outside of a testing environment.

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®.