The Wind River Hypervisor User’s Guide does a good job at explaining how to configure a device for direct assignment (a.k.a. passthrough) to a Virtual Board (VB). If you have followed the directions but are not seeing the device made available in the Guest OS, there is a good chance you also need to passthrough the PCI bridge that the device is sitting behind.

 

Let’s take a look at an example. Suppose I have an onboard Ethernet port that I would like to assign directly to a VB. Assuming we have the hypervisor booting on the target and are capable of getting to the hypervisor shell, running a ‘lspci –x’ allows me to get the PhysicalDevice entry that belongs in the PhysicalBoard.xml for my Ethernet port:

 

<PhysicalDevice Template="generic">

    <Location Bus="10" Device="0"  Function="0" />

    <!-- VendorID: 0x150e ID: 0x8086 -->

    <InterruptList>

        <Interrupt IntNum="16"/>

    </InterruptList>

    <RegSetList>

        <RegSet Address="0xd1f60000" Length="0x20000"/>

        <RegSet Address="0x00002060" Length="0x20"/>

        <RegSet Address="0xd1fb0000" Length="0x4000"/>

    </RegSetList>

</PhysicalDevice>

 

Adding an entry in the wrhvConfig.xml to create the System Device (this is what will be "assigned" to the Virtual Board):

 

<SystemDevice Name=”eth0” Type=”Passthrough” DeviceNameRef=”pciEthernet0_dev” />

 

And then the corresponding entry in my Linux.xml (This is my Virtual Board configuration file for a Linux Guest OS):

 

<GuestDevice DeviceNameRef="eth0" PciWriteEnable="1">

                        <InterruptList>

                                <Interrupt IntNum="145" Core="0" />

                         </InterruptList>

                        <RegSetList>

                                <RegSet Length="0x20000"

                                        Address="0xd1f60000" />

                                <RegSet Length="0x20"

                                        Address="0x00002060" />

                                 <RegSet Length="0x4000"

                                        Address="0xd1fb0000" />

                        </RegSetList>

</GuestDevice>

 

At this point it would seem that all of the configuration has been completed to passthrough the Ethernet port that lives at Bus: 10  Device: 0  Function: 0. We have created the necessary entries in the PhysicalBoard, wrhvConfig, and Linux configuration files, and specified the BAR addresses and assigned an interrupt vector. This is where the documentation stops and at this point you are done. Unfortunately, if you build your hypervisor and boot on the target, the device will not show up in the Guest.

 

root@localhost:/root> lspci

00:00.0 Host bridge: Intel Corporation Device 3c00 (rev 03)

 

All that shows up is the PCI Host Bridge, no Ethernet adapter.

 

If we take a closer look at the output we got earlier from the ‘lspci –x’ from the hypervisor shell, there is another PhysicalDevice which is worth looking at:

 

<PhysicalDevice Template="pcibridge">

    <Location Bus="0"  Device="28" Function="0" />

    <!--Subordinate Bus: 0x0a

    Secondary Bus: 0x0a

    Primary Bus: 0x00 -->

    <!-- VendorID: 0x1d10 ID: 0x8086 -->

    <InterruptList>

        <Interrupt IntNum="16"/>

    </InterruptList>

</PhysicalDevice>

 

This ‘pciPCI6_dev’ PhysicalDevice is of type pcibridge, and has a secondary bus of 0x0a (or 10 decimal). This means we also have to pass through this device to the same VB in order for our Ethernet port (which was on Bus 10) to be visible from the Guest.

 

So in wrhvConfig.xml we would require an entry in the SystemDeviceList for the PCI Bridge:

 

<SystemDevice DeviceNameRef=" pciPCI6_dev "/>

 

And the corresponding entry in our Linux.xml:

 

<GuestDevice

                        DeviceNameRef=" pciBridge-eth0" PciWriteEnable="0">

                        <InterruptList>

                                <Interrupt IntNum="16" Core="0" />

                        </InterruptList>

</GuestDevice>

 

Rebuild and boot the image on the target, and now you should see your device:

 

root@localhost:/root> lspci

00:00.0 Host bridge: Intel Corporation Device 3c00 (rev 03)

00:1c.0 PCI bridge: Intel Corporation Device 1d10 (rev b4)

0a:00.0 Ethernet controller: Intel Corporation Device 150e (rev 01)

 

The process of assigning the PCI Bridge in addition to the device is an additional step that may not be obvious to users of other hypervisors.

 

Hope this helps!