KVM: MMU: avoid pte_list_desc running out in kvm_mmu_pte_write
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Thu, 22 Sep 2011 08:53:17 +0000 (16:53 +0800)
committerAvi Kivity <avi@redhat.com>
Tue, 27 Dec 2011 09:16:47 +0000 (11:16 +0200)
commitf759e2b4c728cee82e4bc1132d0e41177b79a0b1
tree1b01eb0b666a8990366c601d96e7d1083730ae28
parent51cfe38ea50aa631f58ed8c340ed6f0143c325a8
KVM: MMU: avoid pte_list_desc running out in kvm_mmu_pte_write

kvm_mmu_pte_write is unsafe since we need to alloc pte_list_desc in the
function when spte is prefetched, unfortunately, we can not know how many
spte need to be prefetched on this path, that means we can use out of the
free  pte_list_desc object in the cache, and BUG_ON() is triggered, also some
path does not fill the cache, such as INS instruction emulated that does not
trigger page fault

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c