Skip to content

Commit 9a37681

Browse files
yanzhao56sean-jc
authored andcommitted
KVM: x86/mmu: Zap SPTEs on MTRR update iff guest MTRRs are honored
When guest MTRRs are updated, zap SPTEs and do zap range calcluation if and only if KVM's MMU is honoring guest MTRRs, which is the only time that KVM incorporates the guest's MTRR type into the final memtype. Suggested-by: Chao Gao <[email protected]> Suggested-by: Sean Christopherson <[email protected]> Cc: Kai Huang <[email protected]> Signed-off-by: Yan Zhao <[email protected]> Link: https://lore.kernel.org/r/[email protected] [sean: rephrase shortlog] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 7a18c7c commit 9a37681

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/mtrr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static void update_mtrr(struct kvm_vcpu *vcpu, u32 msr)
320320
struct kvm_mtrr *mtrr_state = &vcpu->arch.mtrr_state;
321321
gfn_t start, end;
322322

323-
if (!tdp_enabled || !kvm_arch_has_noncoherent_dma(vcpu->kvm))
323+
if (!kvm_mmu_honors_guest_mtrrs(vcpu->kvm))
324324
return;
325325

326326
if (!mtrr_is_enabled(mtrr_state) && msr != MSR_MTRRdefType)

0 commit comments

Comments
 (0)