aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorPeter Feiner <pfeiner@google.com>2016-09-26 13:45:34 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-02 16:32:17 -0400
commit66d73e12f2786497424cb611b359e3580978cad7 (patch)
tree94b7661ba7d4984e06b2b5f5a1fae2368566b4c2 /arch/x86/kvm/mmu.c
parentc63e45635bfabc6c01324bd79bc75aa183c828ad (diff)
KVM: X86: MMU: no mmu_notifier_seq++ in kvm_age_hva
The MMU notifier sequence number keeps GPA->HPA mappings in sync when GPA->HPA lookups are done outside of the MMU lock (e.g., in tdp_page_fault). Since kvm_age_hva doesn't change GPA->HPA, it's unnecessary to increment the sequence number. Signed-off-by: Peter Feiner <pfeiner@google.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index d9c7e986b4e4..d3a94ea9f6ac 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1660,17 +1660,9 @@ int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end)
1660 * This has some overhead, but not as much as the cost of swapping 1660 * This has some overhead, but not as much as the cost of swapping
1661 * out actively used pages or breaking up actively used hugepages. 1661 * out actively used pages or breaking up actively used hugepages.
1662 */ 1662 */
1663 if (!shadow_accessed_mask) { 1663 if (!shadow_accessed_mask)
1664 /*
1665 * We are holding the kvm->mmu_lock, and we are blowing up
1666 * shadow PTEs. MMU notifier consumers need to be kept at bay.
1667 * This is correct as long as we don't decouple the mmu_lock
1668 * protected regions (like invalidate_range_start|end does).
1669 */
1670 kvm->mmu_notifier_seq++;
1671 return kvm_handle_hva_range(kvm, start, end, 0, 1664 return kvm_handle_hva_range(kvm, start, end, 0,
1672 kvm_unmap_rmapp); 1665 kvm_unmap_rmapp);
1673 }
1674 1666
1675 return kvm_handle_hva_range(kvm, start, end, 0, kvm_age_rmapp); 1667 return kvm_handle_hva_range(kvm, start, end, 0, kvm_age_rmapp);
1676} 1668}