<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">El 18 oct. 2017 8:53 p. m., "Alex Williamson" <<a href="mailto:alex.williamson@redhat.com">alex.williamson@redhat.com</a>> escribió<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">
<br>
</div>As of kernel v4.12, Legacy KVM device assignment has been removed from<br>
the kernel (it had previously been deprecated), so I suggest to start<br>
with migrating your configuration to using vfio-pci instead.  You can<br>
find vfio documentation in the Linux kernel tree:<br>
<br>
<a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/vfio.txt" rel="noreferrer" target="_blank">https://git.kernel.org/pub/<wbr>scm/linux/kernel/git/torvalds/<wbr>linux.git/tree/Documentation/<wbr>vfio.txt</a><br>
<br>
In my blog:<br>
<br>
<a href="http://vfio.blogspot.com/" rel="noreferrer" target="_blank">http://vfio.blogspot.com/</a><br>
<br>
And various other places.<br>
<br>
Regarding interrupt behavior, without additional hardware assistance,<br>
assigned device interrupts are handled by the host kernel and injected<br>
into the guest.  This does not generally incur much load on the host<br>
since the interrupt is simply forwarded and not serviced at the device<br>
in the host.  Usually the problem here is the additional latency, which<br>
is one of the more notable overheads when using device assignment.<br>
<br>
Various processor offloads can help to alleviate this.  Intel first<br>
introduced APICv, which among other things, allows interrupts to be<br>
injected into the VM via IPI without incurring a vm-exit.  To take<br>
advantage of this, you'd want a) hardware supporting APICv and b)<br>
redirect the physical interrupt to a host processor not running a vCPU<br>
such that the interrupt itself doesn't trigger a world switch.  The<br>
kvm_intel module has an enable_apicv option, if you can't enable it, as<br>
seen in /sys/module/kvm_intel/<wbr>parameters/enable_apicv, then your<br>
hardware doesn't support it.<br>
<br>
Newer yet Intel hardware supports posted interrupts, which allows<br>
interrupts to be injected directly into the VM, bypassing the host<br>
entirely.  This one is even trickier to setup AIUI the interrupt needs<br>
to arrive to the pCPU while it's running the vCPU to which the<br>
interrupt is directed in the VM. I'm not entirely sure how to test for<br>
this support, but unless you're running pretty recent Xeon E5+<br>
processors, it's probably safe to assume it's not there.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">When you say recent Xeon E5+, you mean, for example Xeon E5-2650-v4 processor?</span><br></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The above optimizations also assume that you're using a modern device<br>
which supports nicely aligned MMIO mapped registers and MSI or MSI/X<br>
interrupts.  If you're using a device that requires INTx or makes use<br>
of I/O port registers, or interacts with PCI config space of the device<br>
on each interrupt, or perhaps even if you're using an old OS in the VM<br>
that flips MSI mask bits regularly, most of those actions require<br>
hypervisor interaction and will reduce the performance and increase the<br>
overhead of the device.  Thanks,<br>
<br>
Alex<br>
<div class="elided-text"><br>
______________________________<wbr>_________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/vfio-users</a><br>
</div></blockquote></div><br></div><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra" dir="auto">Greetings</div></div></div>