PCI Passthrough on PowerKVM

From 2.1.1 PCI passthrough is supported.  PCI passthorugh as same as x86. Ofcourse all powerkvm operations are as same as x86_64.

Steps:

Here we go

1) Identify the PCI device on host.

[root@pkvm ~]# lspci | grep Ethernet
0001:03:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:03:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:03:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:03:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:05:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:05:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0001:05:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0003:05:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0003:05:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0003:05:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0003:05:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0006:01:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0006:01:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0006:01:00.2 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
0006:01:00.3 Ethernet controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet PCIe (rev 01)
[root@pkvm ~]#

[snip]

[root@pkvm ~]# virsh nodedev-list –cap pci
pci_0000_00_00_0
pci_0000_01_00_0
pci_0000_01_00_1
pci_0001_00_00_0
pci_0001_01_00_0
pci_0001_02_01_0
pci_0001_02_08_0
pci_0001_02_09_0
pci_0001_03_00_0
pci_0001_03_00_1
pci_0001_03_00_2
pci_0001_03_00_3
pci_0001_04_00_0
pci_0001_05_00_0
pci_0001_05_00_1
pci_0001_05_00_2
pci_0001_05_00_3

[snip]

[root@pkvm ~]#

2) get the details to update guest xml ( which you want to setup passthrough)

[root@pkvm ~]# virsh nodedev-dumpxml pci_0001_05_00_3
<device>
<name>pci_0001_05_00_3</name>
/sys/devices/pci0001:00/0001:00:00.0/0001:01:00.0/0001:02:09.0/0001:05:00.3
<parent>pci_0001_02_09_0</parent>
<driver>
<name>tg3</name>
</driver>
<capability type=’pci’>
<domain>1</domain>
<bus>5</bus>
<slot>0</slot>
<function>3</function>
NetXtreme BCM5719 Gigabit Ethernet PCIe
<vendor id=’0x14e4′>Broadcom Corporation</vendor>
<iommuGroup number=’2′>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x0’/>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x1’/>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x2’/>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x3’/>
</iommuGroup>
</capability>
</device>

[root@pkvm ~]#

3.  Assign all/some of the functions of Ethernet card to the guest by adding following XML entries in guest XML.

 

<hostdev mode=’subsystem’ type=’pci’ managed=’yes’>
<source>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x0’/>
</source>
<!–hostdev>

<hostdev mode=’subsystem’ type=’pci’ managed=’yes’>
<source>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x1’/>
</source>
<!–hostdev>

<hostdev mode=’subsystem’ type=’pci’ managed=’yes’>
<source>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x2’/>
</source>
</hostdev>

<hostdev mode=’subsystem’ type=’pci’ managed=’yes’>
<source>
<address domain=’0x0001′ bus=’0x05′ slot=’0x00′ function=’0x3’/>
</source>
</hostdev>

Thanks to Pradipta Kumar

Advertisements

One thought on “PCI Passthrough on PowerKVM

  1. Pingback: Bring Up PowerKVM | Pradeep K Surisetty

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s