KVM: MMU audit: update count_writable_mappings / count_rmaps
authorMarcelo Tosatti <mtosatti@redhat.com>
Wed, 10 Jun 2009 15:27:04 +0000 (12:27 -0300)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 05:32:53 +0000 (08:32 +0300)
commit08a3732bf2e68048c9166e929ca2115127a412ab
tree6f741496cf7c0932512e8af2833ca2596b4aebf9
parent776e6633363b5616be6fa4493a8b70ef8e2ea04b
KVM: MMU audit: update count_writable_mappings / count_rmaps

Under testing, count_writable_mappings returns a value that is 2 integers
larger than what count_rmaps returns.

Suspicion is that either of the two functions is counting a duplicate (either
positively or negatively).

Modifying check_writable_mappings_rmap to check for rmap existance on
all present MMU pages fails to trigger an error, which should keep Avi
happy.

Also introduce mmu_spte_walk to invoke a callback on all present sptes visible
to the current vcpu, might be useful in the future.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c