OSDN Git Service

KVM: SVM: Use kvm_pat_valid() directly instead of kvm_mtrr_valid()
authorKe Guo <guoke@uniontech.com>
Thu, 11 May 2023 23:33:45 +0000 (16:33 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 1 Jun 2023 20:41:05 +0000 (13:41 -0700)
commit7aeae027611ff27f13a32e19736c8fd06e41786c
tree84e5b160a8a0d18edaaeb0783165e87ff215a468
parenta33ba1bf0dc6082227d1ddf964632e07b53b8971
KVM: SVM: Use kvm_pat_valid() directly instead of kvm_mtrr_valid()

Use kvm_pat_valid() directly instead of bouncing through kvm_mtrr_valid().
The PAT is not an MTRR, and kvm_mtrr_valid() just redirects to
kvm_pat_valid(), i.e. is exempt from KVM's "zap SPTEs" logic that's
needed to honor guest MTRRs when the VM has a passthrough device with
non-coherent DMA (KVM does NOT set "ignore guest PAT" in this case, and so
enables hardware virtualization of the guest's PAT, i.e. doesn't need to
manually emulate the PAT memtype).

Signed-off-by: Ke Guo <guoke@uniontech.com>
[sean: massage changelog]
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/r/20230511233351.635053-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c