KVM: MMU: make kvm_mmu_available_pages robust against n_used_mmu_pages > n_max_mmu_pages
authorMarcelo Tosatti <mtosatti@redhat.com>
Wed, 13 Mar 2013 01:36:43 +0000 (22:36 -0300)
committerGleb Natapov <gleb@redhat.com>
Wed, 13 Mar 2013 09:46:09 +0000 (11:46 +0200)
commit5d218814328da91a27e982748443e7e375e11396
tree46ef91eb8d845cea7500450fb041b9e5e444e63f
parent57f252f22908535e04d520f3833a6e3116eb159d
KVM: MMU: make kvm_mmu_available_pages robust against n_used_mmu_pages > n_max_mmu_pages

As noticed by Ulrich Obergfell <uobergfe@redhat.com>, the mmu
counters are for beancounting purposes only - so n_used_mmu_pages and
n_max_mmu_pages could be relaxed (example: before f0f5933a1626c8df7b),
resulting in n_used_mmu_pages > n_max_mmu_pages.

Make code robust against n_used_mmu_pages > n_max_mmu_pages.

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/mmu.h