diff options
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index e79c54034bcd..b7c78a403dc2 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -850,6 +850,19 @@ static void kvm_mmu_notifier_invalidate_page(struct mmu_notifier *mn, | |||
850 | 850 | ||
851 | } | 851 | } |
852 | 852 | ||
853 | static void kvm_mmu_notifier_change_pte(struct mmu_notifier *mn, | ||
854 | struct mm_struct *mm, | ||
855 | unsigned long address, | ||
856 | pte_t pte) | ||
857 | { | ||
858 | struct kvm *kvm = mmu_notifier_to_kvm(mn); | ||
859 | |||
860 | spin_lock(&kvm->mmu_lock); | ||
861 | kvm->mmu_notifier_seq++; | ||
862 | kvm_set_spte_hva(kvm, address, pte); | ||
863 | spin_unlock(&kvm->mmu_lock); | ||
864 | } | ||
865 | |||
853 | static void kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, | 866 | static void kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, |
854 | struct mm_struct *mm, | 867 | struct mm_struct *mm, |
855 | unsigned long start, | 868 | unsigned long start, |
@@ -929,6 +942,7 @@ static const struct mmu_notifier_ops kvm_mmu_notifier_ops = { | |||
929 | .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start, | 942 | .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start, |
930 | .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end, | 943 | .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end, |
931 | .clear_flush_young = kvm_mmu_notifier_clear_flush_young, | 944 | .clear_flush_young = kvm_mmu_notifier_clear_flush_young, |
945 | .change_pte = kvm_mmu_notifier_change_pte, | ||
932 | .release = kvm_mmu_notifier_release, | 946 | .release = kvm_mmu_notifier_release, |
933 | }; | 947 | }; |
934 | #endif /* CONFIG_MMU_NOTIFIER && KVM_ARCH_WANT_MMU_NOTIFIER */ | 948 | #endif /* CONFIG_MMU_NOTIFIER && KVM_ARCH_WANT_MMU_NOTIFIER */ |