diff options
author | Andres Lagar-Cavilla <andreslc@google.com> | 2014-09-22 17:54:42 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-24 08:07:58 -0400 |
commit | 57128468080a8b6ea452223036d3e417f748af55 (patch) | |
tree | e89cfc349a9c39710cfab4e387119365a0d64958 /arch/powerpc/kvm/book3s.c | |
parent | 8a9522d2fe6a1b643d3aef5ab7f097f73c601e7a (diff) |
kvm: Fix page ageing bugs
1. We were calling clear_flush_young_notify in unmap_one, but we are
within an mmu notifier invalidate range scope. The spte exists no more
(due to range_start) and the accessed bit info has already been
propagated (due to kvm_pfn_set_accessed). Simply call
clear_flush_young.
2. We clear_flush_young on a primary MMU PMD, but this may be mapped
as a collection of PTEs by the secondary MMU (e.g. during log-dirty).
This required expanding the interface of the clear_flush_young mmu
notifier, so a lot of code has been trivially touched.
3. In the absence of shadow_accessed_mask (e.g. EPT A bit), we emulate
the access bit by blowing the spte. This requires proper synchronizing
with MMU notifier consumers, like every other removal of spte's does.
Signed-off-by: Andres Lagar-Cavilla <andreslc@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index dd03f6b299ba..c16cfbfeb781 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -851,9 +851,9 @@ int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end) | |||
851 | return kvm->arch.kvm_ops->unmap_hva_range(kvm, start, end); | 851 | return kvm->arch.kvm_ops->unmap_hva_range(kvm, start, end); |
852 | } | 852 | } |
853 | 853 | ||
854 | int kvm_age_hva(struct kvm *kvm, unsigned long hva) | 854 | int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end) |
855 | { | 855 | { |
856 | return kvm->arch.kvm_ops->age_hva(kvm, hva); | 856 | return kvm->arch.kvm_ops->age_hva(kvm, start, end); |
857 | } | 857 | } |
858 | 858 | ||
859 | int kvm_test_age_hva(struct kvm *kvm, unsigned long hva) | 859 | int kvm_test_age_hva(struct kvm *kvm, unsigned long hva) |