KVM: svm: handle KVM_X86_QUIRK_CD_NW_CLEARED in svm_get_mt_mask
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jul 2015 11:32:13 +0000 (13:32 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Jul 2015 06:30:27 +0000 (08:30 +0200)
commit5492830370171b6a4ede8a3bfba687a8d0f25fa5
tree44d7c401f31b3256be49f7f8db277b18506ce2d5
parent5f3d45e7f2827f48e60eb821efd909713b43ac63
KVM: svm: handle KVM_X86_QUIRK_CD_NW_CLEARED in svm_get_mt_mask

We can disable CD unconditionally when there is no assigned device.
KVM now forces guest PAT to all-writeback in that case, so it makes
sense to also force CR0.CD=0.

When there are assigned devices, emulate cache-disabled operation
through the page tables.  This behavior is consistent with VMX
microcode, where CD/NW are not touched by vmentry/vmexit.  However,
keep this dependent on the quirk because OVMF enables the caches
too late.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c