KVM: MMU: rewrite audit_mappings_page() function
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Sat, 28 Aug 2010 11:24:13 +0000 (19:24 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:48 +0000 (10:51 +0200)
commit365fb3fdf6769d3553999d8eb6cc2a8c56c747c1
treee8ac38a587a4cf2cac88df4580e7112c15b13e14
parentbc32ce2152406431acf4daf4a81dc1664bb7b91b
KVM: MMU: rewrite audit_mappings_page() function

There is a bugs in this function, we call gfn_to_pfn() and kvm_mmu_gva_to_gpa_read() in
atomic context(kvm_mmu_audit() is called under the spinlock(mmu_lock)'s protection).

This patch fix it by:
- introduce gfn_to_pfn_atomic instead of gfn_to_pfn
- get the mapping gfn from kvm_mmu_page_get_gfn()

And it adds 'notrap' ptes check in unsync/direct sps

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