KVM: MMU: consider host cache mode in MMIO page check
authorHaozhong Zhang <haozhong.zhang@intel.com>
Wed, 20 Dec 2017 07:29:29 +0000 (15:29 +0800)
committerRadim Krčmář <rkrcmar@redhat.com>
Tue, 16 Jan 2018 15:40:09 +0000 (16:40 +0100)
commitaa2e063aea7961fb58eafecb924f8818e3d4ecfc
tree9a877c25b1e61c226ed1d225702ca3331f05a5b3
parentb8d7044bcff7a955257b242515bcf1e5045edd9b
KVM: MMU: consider host cache mode in MMIO page check

Some reserved pages, such as those from NVDIMM DAX devices, are not
for MMIO, and can be mapped with cached memory type for better
performance. However, the above check misconceives those pages as
MMIO.  Because KVM maps MMIO pages with UC memory type, the
performance of guest accesses to those pages would be harmed.
Therefore, we check the host memory type in addition and only treat
UC/UC-/WC pages as MMIO.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reported-by: Cuevas Escareno, Ivan D <ivan.d.cuevas.escareno@intel.com>
Reported-by: Kumar, Karthik <karthik.kumar@intel.com>
Reviewed-by: Xiao Guangrong <xiaoguangrong@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/mmu.c