diff options
author | Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> | 2013-06-20 12:34:31 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-06-27 07:20:49 -0400 |
commit | 7a2e8aaf0f6873b47bc2347f216ea5b0e4c258ab (patch) | |
tree | f5f908921cfd899e706cb455acb91d74c9ba894f /arch/x86 | |
parent | 5a9b3830d462971bf05329148873f8996d1c88fc (diff) |
KVM: MMU: Inform users of mmio generation wraparound
Without this information, users will just see unexpected performance
problems and there is little chance we will get good reports from them:
note that mmio generation is increased even when we just start, or stop,
dirty logging for some memory slot, in which case users cannot expect
all shadow pages to be zapped.
printk_ratelimited() is used for this taking into account the problems
that we can see the information many times when we start multiple VMs
and guests can trigger this by reading ROM in a loop for example.
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/mmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index f385a4cf4bfd..0d094da49541 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -4387,8 +4387,10 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm) | |||
4387 | * The max value is MMIO_MAX_GEN - 1 since it is not called | 4387 | * The max value is MMIO_MAX_GEN - 1 since it is not called |
4388 | * when mark memslot invalid. | 4388 | * when mark memslot invalid. |
4389 | */ | 4389 | */ |
4390 | if (unlikely(kvm_current_mmio_generation(kvm) >= (MMIO_MAX_GEN - 1))) | 4390 | if (unlikely(kvm_current_mmio_generation(kvm) >= (MMIO_MAX_GEN - 1))) { |
4391 | printk_ratelimited(KERN_INFO "kvm: zapping shadow pages for mmio generation wraparound\n"); | ||
4391 | kvm_mmu_invalidate_zap_all_pages(kvm); | 4392 | kvm_mmu_invalidate_zap_all_pages(kvm); |
4393 | } | ||
4392 | } | 4394 | } |
4393 | 4395 | ||
4394 | static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc) | 4396 | static int mmu_shrink(struct shrinker *shrink, struct shrink_control *sc) |