<div dir="ltr"><div><div><div>Hi Wei,<br><br></div>My system is a desktop, so it must just be a general Gigabyte BIOS bug. I submitted a help ticket about this issue and just gave a brief explanation and then sent Alex's explanation. Hopefully it will be escalated correctly.<br><br></div>Thanks,<br></div>Nick<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 20, 2016 at 1:08 PM, Wei Xu <span dir="ltr"><<a href="mailto:wexu@redhat.com" target="_blank">wexu@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 2016年09月20日 22:20, Alex Williamson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, 20 Sep 2016 08:14:45 -0600<br>
Alex Williamson <<a href="mailto:alex.williamson@redhat.com" target="_blank">alex.williamson@redhat.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, 20 Sep 2016 21:56:33 +0800<br>
Wei Xu <<a href="mailto:wexu@redhat.com" target="_blank">wexu@redhat.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 2016年09月20日 09:59, Alex Williamson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, 20 Sep 2016 09:28:57 +0800<br>
Wei Xu <<a href="mailto:wexu@redhat.com" target="_blank">wexu@redhat.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Guys,<br>
I'm trying to pass through a rtl8168 nic to linux guest on my laptop<br>
recently, the link is directly connected to my notebook with a cable.<br>
<br>
qemu: 2.7.0-rc4<br>
host/guest kernel: 4.7.0-rc5<br>
driver name: r8169<br>
<br>
After binding the driver to vfio-pci and launching the VM for a few<br>
seconds, the connection led on the nic was turned off, and the guest<br>
only see a link down nic with below messages.<br>
<br>
[    6.173188] r8169 0000:00:04.0 ens4: rtl_phy_reset_cond == 1 (loop:<br>
100, delay: 1).<br>
[    6.177234] r8169 0000:00:04.0 ens4: link down<br>
[    6.177592] r8169 0000:00:04.0 ens4: link down<br>
[    6.177889] IPv6: ADDRCONF(NETDEV_UP): ens4: link is not ready<br>
<br>
<br>
It's quite similar as below bug except it's for windows driver while<br>
i'm testing linux.<br>
<br>
<a href="https://bugs.launchpad.net/qemu/+bug/1384892" rel="noreferrer" target="_blank">https://bugs.launchpad.net/qem<wbr>u/+bug/1384892</a><br>
<br>
<br>
More info:<br>
My vm image is a pre-installed fedora 22 desktop, i also tried a fresh<br>
fedora live iso, looks it can load the driver correctly.<br>
<br>
I tried to disable auto negotiation for the link but it didn't work for me.<br>
<br>
I did the same test with my notebook with a Intel I218-LM ethernet<br>
controller, it works pretty well every time.<br>
<br>
I googled around and looks it happened to bare metal too, so just wonder<br>
if this is a bug of network-manager, or is being caused by the nic<br>
driver or an issue in qemu/kernel vfio, anybody can help?<br>
</blockquote>
<br>
Realtek nics don't work well with device assignment, they barely work<br>
well on bare metal.  Stick with the Intel nic or just use the rtl nic<br>
with virtio.  I've spent longer than I care to admit on the rtl quirks<br>
we have in QEMU and I expect they still only work with a few devices.<br>
</blockquote>
<br>
OK, I'll ignore Realtek, so I added one Intel iwl6235 wireless nic to my<br>
laptop, the pci tree shows both the rtl and iwl are behind a separate<br>
pci bridge, after bind iwl to vfio-pci driver, i failed to pass through<br>
it again with error message from qemu.<br>
<br>
qemu-system-x86_64: -device vfio-pci,host=0000:02:00.0: vfio: error,<br>
group 5 is not viable, please ensure all devices within the iommu_group<br>
are bound to their vfio bus driver.<br>
qemu-system-x86_64: -device vfio-pci,host=0000:02:00.0: vfio: failed to<br>
get group 5<br>
qemu-system-x86_64: -device vfio-pci,host=0000:02:00.0: Device<br>
initialization failed<br>
<br>
Seems it's caused by the rtl nic is under the same iommu group with iwl<br>
as well, and when the kernel vfio driver checking the viablity, it'll<br>
make sure all the devices under the same group are viable, it works fine<br>
after i bound the rtl to vfio-pci too, i'm wonder if this a discipline?<br>
can't i just bind the iwl nic and pass through the the guest?<br>
<br>
pci tree:<br>
-[0000:00]-+-00.0 Intel Corporation Sky Lake Host Bridge/DRAM Registers<br>
+-1c.0-[01]----00.0 Realtek Semiconductor Co., Ltd. RTL8111/8168/8411<br>
PCI Express Gigabit Ethernet Controller<br>
+-1c.7-[02]----00.0 Intel Corporation Centrino Advanced-N 6235<br>
</blockquote>
<br>
If your PCH root ports report an ACS capability then you can run kernel<br>
v4.7 kernel on the host to expose the isolation.  If the root ports<br>
(00:1c.*) do not expose an ACS capability, it's probably a BIOS bug<br>
similar to Nick's system in this thread<br>
<a href="https://www.redhat.com/archives/vfio-users/2016-September/msg00059.html" rel="noreferrer" target="_blank">https://www.redhat.com/archive<wbr>s/vfio-users/2016-September/<wbr>msg00059.html</a><br>
</blockquote>
<br>
And I see you're running a v4.7 kernel already (though I'm not sure why<br>
you're running an rc release for kernel or QEMU since both of those<br>
have been released).  So you need to check them with lspci to see if an<br>
ACS capability is exposed on the root ports, check whether your root<br>
ports are covered by the device IDs in this quirk:<br>
<br>
<a href="http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1bf2bf229b64540f91ac6fa3af37c81249037a0b" rel="noreferrer" target="_blank">http://git.kernel.org/cgit/lin<wbr>ux/kernel/git/torvalds/linux.<wbr>git/commit/?id=1bf2bf229b64540<wbr>f91ac6fa3af37c81249037a0b</a><br>
<br>
If there's no ACS capability but the root ports fall within the quirk,<br>
it's a BIOS bug on the system.  Sorry.<br>
</blockquote>
<br></div></div>
Unfortunately, the device id is within your list in the commit qurik<br>
but it failed still, my ACS dump of pci is as the same as Nick's, just<br>
wondering why the bios doesn't report it, looks it's a default option<br>
for most of laptops, do you know what's the possible reason behind that?<br>
to connect all the components by default even with VT-d enabled?<br>
<br>
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #5 (rev f1)<br>
00: 86 80 14 a1 07 00 10 00 f1 00 04 06 00 00 81 00<br>
10: 00 00 00 00 00 00 00 00 00 01 01 00 e0 e0 00 20<br>
20: 10 df 10 df f1 ff 01 00 00 00 00 00 00 00 00 00<br>
30: 00 00 00 00 40 00 00 00 00 00 00 00 0a 01 10 00<br>
40: 10 80 42 01 01 80 00 00 00 00 10 00 13 40 72 05<br>
50: 40 00 11 70 00 b2 44 00 00 00 40 01 00 00 00 00<br>
60: 00 00 00 00 37 08 00 00 00 04 00 00 0e 00 00 00<br>
70: 03 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
80: 05 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
90: 0d a0 00 00 58 14 01 50 00 00 00 00 00 00 00 00<br>
a0: 01 00 03 c8 00 00 00 00 00 00 00 00 00 00 00 00<br>
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
d0: 01 10 00 07 42 18 00 00 08 00 1e 8b 00 00 00 00<br>
e0: 00 b7 f3 00 00 00 00 00 06 80 12 00 00 00 00 00<br>
f0: 50 00 00 00 00 03 00 40 b3 0f 33 08 00 00 00 01<br>
100: 01 00 01 22 00 00 00 00 00 00 00 00 11 00 06 00<br>
110: 00 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00<br>
120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
140: 00 00 00 00 0f 00 00 00 00 00 00 00 00 00 00 00<br>
150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
200: 00 00 00 00 1f 28 28 00 00 00 00 00 28 00 00 00<br>
210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>
220: 19 00 01 00 00 00 00 00 00 00 00 00 77 75 77 75<div class="HOEnZb"><div class="h5"><br>
<br>
Thanks,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Alex<br>
<br>
</blockquote>
<br>
______________________________<wbr>_________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com" target="_blank">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/vfio-users</a><br>
</div></div></blockquote></div><br></div>