<div dir="ltr">For adding a bit on this subjects, some games (blizzard games, tomb raider at it's launch) use a lot of msrs during run.<div>It seems this is made for their anti-cheat / hack systems.</div><div><br></div><div>Heroes of the storm, SC2 are spamming these msrs. This reduce performance quite hardly.</div><div><br></div><div>Funny thing: This "bug" does not apply to win8 / win7 :)</div><div><br></div><div>For reference we spoke about such in this thread a long time ago:</div><div><a href="https://www.redhat.com/archives/vfio-users/2016-May/msg00134.html">https://www.redhat.com/archives/vfio-users/2016-May/msg00134.html</a><br></div><div><br></div><div><br></div><div>The kernel spam of such error at Heroes of the storm login screen:</div><div><div>[136995.284205] kvm [6799]: vcpu2, guest rIP: 0xfffff8016e757733 kvm_set_msr_common: MSR_IA32_DEBUGCTLMSR 0x1, nop</div><div>[136995.284217] kvm [6799]: vcpu2, guest rIP: 0xfffff8016e757733 kvm_set_msr_common: MSR_IA32_DEBUGCTLMSR 0x1, nop</div><div>[137000.285330] kvm_get_msr_common: 302015 callbacks suppressed</div><div>[137000.285337] kvm [6799]: vcpu5, guest rIP: 0xfffff8016e75779c ignored rdmsr: 0x1c9</div><div>[137000.285342] kvm [6799]: vcpu5, guest rIP: 0xfffff8016e7577aa ignored rdmsr: 0x680</div><div>[137000.285344] kvm [6799]: vcpu5, guest rIP: 0xfffff8016e7577c1 ignored rdmsr: 0x6c0</div></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--<div>Deldycke Quentin<br></div><div><div><br></div></div></div></div></div>
<br><div class="gmail_quote">On 6 January 2017 at 14:07, Thomas Lindroth <span dir="ltr"><<a href="mailto:thomas.lindroth@gmail.com" target="_blank">thomas.lindroth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 01/06/2017 01:00 PM, Marius Steffen wrote:<br>
</span><span class="">> Is there anything I can do to a) find the cause of this bad performance<br>
> b) make my VM perform better?<br>
<br>
</span>One thing you can try is to run the game with poor performance and at the<br>
same time run "perf kvm --host stat live" on the host. This will show how<br>
many VM-EXIT kvm performs. VM-EXIT means the guest has done something the<br>
hardware virtualisation can't handle, like accessing MSR or virtual IO.<br>
<br>
Some workloads will perform badly because they cause a lot of VM-EXIT.<br>
Perf will tell you why a VM-EXIT was performed. The more common causes are<br>
IO_INSTRUCTION and EPT_MISCONFIG. IO_INSTRUCTION means the guest tried to<br>
access an x86 ioport and EPT_MISCONFIG seems to be an odd name for access<br>
to memory mapped io. Sometimes a lot of time is spent in HLT but that's<br>
normal. It only means the guest OS has nothing to do and goes idle.<br>
<br>
By running "perf kvm --host stat live --event=ioport" you can check which<br>
ioport is accessed and "perf kvm --host stat live --event=mmio" shows<br>
which address was accessed for memory mapped io.<br>
<br>
If you see that an mmio address is accessed a lot and want to find out what<br>
it is you can run "virsh qemu-monitor-command <nameofvm> --hmp 'info mtree'"<br>
to get a list of the memory layout of the VM. Unfortunately I don't know<br>
of any way to get a similar list of ioports.<br>
<br>
As an example on my system some games like Rise of the Tomb Raider and<br>
Assassin's Creed Unity will access ioport 0xb008 more than 200,000 times/sec<br>
and those games will have poor performance compared to native. Qemu<br>
hardcode the acpi timer to ioport 0xb008 and those games excessively read<br>
the hardware timer. I haven't figured out any way to work around the problem<br>
but I run games with vsync on and even with the decreased performance I get<br>
60fps in those titles.<br>
<div class="HOEnZb"><div class="h5"><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></div></blockquote></div><br></div>