Skip to content

Commit f66e50e

Browse files
taosu-linuxsean-jc
authored andcommitted
KVM: x86/mmu: Don't refresh mmu_invalidate_seq after checking private attr
Drop the second snapshot of mmu_invalidate_seq in kvm_faultin_pfn(). Before checking the mismatch of private vs. shared, mmu_invalidate_seq is saved to fault->mmu_seq, which can be used to detect an invalidation related to the gfn occurred, i.e. KVM will not install a mapping in page table if fault->mmu_seq != mmu_invalidate_seq. Currently there is a second snapshot of mmu_invalidate_seq, which may not be same as the first snapshot in kvm_faultin_pfn(), i.e. the gfn attribute may be changed between the two snapshots, but the gfn may be mapped in page table without hindrance. Therefore, drop the second snapshot as it has no obvious benefits. Fixes: f6adeae ("KVM: x86/mmu: Handle no-slot faults at the beginning of kvm_faultin_pfn()") Signed-off-by: Tao Su <tao1.su@linux.intel.com> Reviewed-by: Chao Gao <chao.gao@intel.com> Link: https://lore.kernel.org/r/20240528102234.2162763-1-tao1.su@linux.intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent c3f38fa commit f66e50e

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4400,9 +4400,6 @@ static int kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
44004400
return RET_PF_EMULATE;
44014401
}
44024402

4403-
fault->mmu_seq = vcpu->kvm->mmu_invalidate_seq;
4404-
smp_rmb();
4405-
44064403
/*
44074404
* Check for a relevant mmu_notifier invalidation event before getting
44084405
* the pfn from the primary MMU, and before acquiring mmu_lock.

0 commit comments

Comments
 (0)