]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: prepopulate guest pages after write-protecting
authorMarcelo Tosatti <mtosatti@redhat.com>
Fri, 4 Apr 2008 17:56:44 +0000 (14:56 -0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Apr 2008 09:00:58 +0000 (12:00 +0300)
commitc2746bcff8a0906efb48cb64c5660dfa6f36e71d
tree344f9cbf54082161e54ba77164f55aec695b9403
parent54f17a655531f80102ccfb531427dbeac5268b61
KVM: MMU: prepopulate guest pages after write-protecting

Zdenek reported a bug where a looping "dmsetup status" eventually hangs
on SMP guests.

The problem is that kvm_mmu_get_page() prepopulates the shadow MMU
before write protecting the guest page tables. By doing so, it leaves a
window open where the guest can mark a pte as present while the host has
shadow cached such pte as "notrap". Accesses to such address will fault
in the guest without the host having a chance to fix the situation.

Fix by moving the write protection before the pte prefetch.

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