]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: use NPT page attributes
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jul 2015 12:32:17 +0000 (14:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jul 2015 11:25:26 +0000 (13:25 +0200)
commitd0801bddb31ad1e7c4d2679d5ed098fee628c8cf
tree36e8e5595161f582836a91cd34caf19b15d2cb18
parent2eb85fbab7202f6ea3cdf82334831cc0e0537437
KVM: SVM: use NPT page attributes

Right now, NPT page attributes are not used, and the final page
attribute depends solely on gPAT (which however is not synced
correctly), the guest MTRRs and the guest page attributes.

However, we can do better by mimicking what is done for VMX.
In the absence of PCI passthrough, the guest PAT can be ignored
and the page attributes can be just WB.  If passthrough is being
used, instead, keep respecting the guest PAT, and emulate the guest
MTRRs through the PAT field of the nested page tables.

The only snag is that WP memory cannot be emulated correctly,
because Linux's default PAT setting only includes the other types.

Tested-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c