public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Found workaround/fix for ntp on AMD systems with PCI passthrough
@ 2017-10-24 21:50 geoff
  2017-10-25  5:42 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: geoff @ 2017-10-24 21:50 UTC (permalink / raw)
  To: kvm

Hi All,

I have spent the last few days attempting to track down the cause of the
performance degradation when ntp is enabled on AMD-Vi systems and VGA
pass through.

A few hours ago I identified why Intel is working and AMD is not and 
found a
work around that fixes the problem, I am now seeing near native 
performance
with ntp enabled on an AMD Ryzen platform.

https://www.3dmark.com/3dm/22878932
https://www.3dmark.com/3dm/22879024

Since my understanding of hardware at this level on this platform is 
limited it
needs a guru to take this and implement a fix or perhaps even a quirk 
that can
be enabled to work around this problem.

In svm.c, by just changing the line in `init_vmcb` that reads:

    save->g_pat = svm->vcpu.arch.pat;

To:

    save->g_pat = 0x0606060606060606;

The problem is resolved. From what I understand this is setting a MTTR 
value
that enables Write Back (WB). Since finding this gem I found the 
following patch
set also:

https://patchwork.kernel.org/patch/6748441/

This doesn't fix the problem but it seems to be heading in the right 
direction.

-Geoff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-25  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 21:50 Found workaround/fix for ntp on AMD systems with PCI passthrough geoff
2017-10-25  5:42 ` Paolo Bonzini
2017-10-25  7:21   ` Radim Krčmář
2017-10-25  7:51   ` geoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox