diff options
author | Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> | 2013-07-04 00:41:26 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-18 06:29:26 -0400 |
commit | e6dff7d15edfa90011298c2a37ec7c965c5f9885 (patch) | |
tree | 64e72f019682f0ac4093d5b446f87338caceb451 /arch/x86/kvm/mmu.c | |
parent | e59dbe09f8e6fb8f6ee19dc79d1a2f14299e4cd2 (diff) |
KVM: x86: Avoid zapping mmio sptes twice for generation wraparound
Now that kvm_arch_memslots_updated() catches every increment of the
memslots->generation, checking if the mmio generation has reached its
maximum value is enough.
Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9e9285ae9b94..3a9493ad1066 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -4390,11 +4390,8 @@ void kvm_mmu_invalidate_mmio_sptes(struct kvm *kvm) | |||
4390 | /* | 4390 | /* |
4391 | * The very rare case: if the generation-number is round, | 4391 | * The very rare case: if the generation-number is round, |
4392 | * zap all shadow pages. | 4392 | * zap all shadow pages. |
4393 | * | ||
4394 | * The max value is MMIO_MAX_GEN - 1 since it is not called | ||
4395 | * when mark memslot invalid. | ||
4396 | */ | 4393 | */ |
4397 | if (unlikely(kvm_current_mmio_generation(kvm) >= (MMIO_MAX_GEN - 1))) { | 4394 | if (unlikely(kvm_current_mmio_generation(kvm) >= MMIO_MAX_GEN)) { |
4398 | printk_ratelimited(KERN_INFO "kvm: zapping shadow pages for mmio generation wraparound\n"); | 4395 | printk_ratelimited(KERN_INFO "kvm: zapping shadow pages for mmio generation wraparound\n"); |
4399 | kvm_mmu_invalidate_zap_all_pages(kvm); | 4396 | kvm_mmu_invalidate_zap_all_pages(kvm); |
4400 | } | 4397 | } |