KVM: MMU: Validate all gptes during fetch, not just those used for new pages
authorAvi Kivity <avi@redhat.com>
Tue, 13 Jul 2010 11:27:10 +0000 (14:27 +0300)
committerAvi Kivity <avi@redhat.com>
Mon, 2 Aug 2010 03:40:47 +0000 (06:40 +0300)
commit5991b33237b7fc7dd9f62ae04998c42217d444a7
treedadadd3c7329e073f64af5e13260b4d732d35cb3
parent0b3c933302262d83018dd5f69656bca9f28a0cd3
KVM: MMU: Validate all gptes during fetch, not just those used for new pages

Currently, when we fetch an spte, we only verify that gptes match those that
the walker saw if we build new shadow pages for them.

However, this misses the following race:

  vcpu1            vcpu2

  walk
                  change gpte
                  walk
                  instantiate sp

  fetch existing sp

Fix by validating every gpte, regardless of whether it is used for building
a new sp or not.

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