KVM: MMU: Fix SMP shadow instantiation race
commit7819026eefee53eaaac3fdce1a2f157c7ea943fe
authorMarcelo Tosatti <marcelo@kvack.org>
Wed, 12 Dec 2007 00:12:27 +0000 (11 19:12 -0500)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:53:21 +0000 (30 17:53 +0200)
treee5ee690406a8ebe381ce5d712f010a5a0c706c4c
parent1d075434149c38d457c30d1f11d9c39210b0bb79
KVM: MMU: Fix SMP shadow instantiation race

There is a race where VCPU0 is shadowing a pagetable entry while VCPU1
is updating it, which results in a stale shadow copy.

Fix that by comparing the contents of the cached guest pte with the
current guest pte after write-protecting the guest pagetable.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/mmu.c
drivers/kvm/paging_tmpl.h