]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: obey guest PAT
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 26 Oct 2017 07:13:27 +0000 (09:13 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 17 Nov 2017 12:20:06 +0000 (13:20 +0100)
commit7b0570593158347974eed169ad7db35dee917e9d
tree906c5f721ef96e093d52884af1d6a857d8811179
parentccf48c0031691a8ae1f213ec5a3f64562c15d55c
KVM: SVM: obey guest PAT

For many years some users of assigned devices have reported worse
performance on AMD processors with NPT than on AMD without NPT,
Intel or bare metal.

The reason turned out to be that SVM is discarding the guest PAT
setting and uses the default (PA0=PA4=WB, PA1=PA5=WT, PA2=PA6=UC-,
PA3=UC).  The guest might be using a different setting, and
especially might want write combining but isn't getting it
(instead getting slow UC or UC- accesses).

Thanks a lot to geoff@hostfission.com for noticing the relation
to the g_pat setting.  The patch has been tested also by a bunch
of people on VFIO users forums.

Fixes: bd2b90fb56f835b4822008fbe398f1fea17d4da7
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196409
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/svm.c