aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2010-09-27 06:07:07 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:53:13 -0400
commitc42fffe3a3aa8c62b8028fff32d18156f5325c3b (patch)
tree6d711887197d665296c27c9359695a76ef0e6734 /arch/x86
parent98224bf1d1783a25ccede29ab08309424ec8de25 (diff)
KVM: MMU: audit: unregister audit tracepoints before module unloaded
fix: Call Trace: [<ffffffffa01e46ba>] ? kvm_mmu_pte_write+0x229/0x911 [kvm] [<ffffffffa01c6ba9>] ? gfn_to_memslot+0x39/0xa0 [kvm] [<ffffffffa01c6c26>] ? mark_page_dirty+0x16/0x2e [kvm] [<ffffffffa01c6d6f>] ? kvm_write_guest_page+0x67/0x7f [kvm] [<ffffffff81066fbd>] ? local_clock+0x2a/0x3b [<ffffffffa01d52ce>] emulator_write_phys+0x46/0x54 [kvm] ...... Code: Bad RIP value. RIP [<ffffffffa0172056>] 0xffffffffa0172056 RSP <ffff880134f69a70> CR2: ffffffffa0172056 Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/mmu.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 88203fa4ef05..afde64ba118d 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3355,15 +3355,6 @@ int kvm_mmu_setup(struct kvm_vcpu *vcpu)
3355 return init_kvm_mmu(vcpu); 3355 return init_kvm_mmu(vcpu);
3356} 3356}
3357 3357
3358void kvm_mmu_destroy(struct kvm_vcpu *vcpu)
3359{
3360 ASSERT(vcpu);
3361
3362 destroy_kvm_mmu(vcpu);
3363 free_mmu_pages(vcpu);
3364 mmu_free_memory_caches(vcpu);
3365}
3366
3367void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot) 3358void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot)
3368{ 3359{
3369 struct kvm_mmu_page *sp; 3360 struct kvm_mmu_page *sp;
@@ -3662,4 +3653,16 @@ EXPORT_SYMBOL_GPL(kvm_mmu_get_spte_hierarchy);
3662 3653
3663#ifdef CONFIG_KVM_MMU_AUDIT 3654#ifdef CONFIG_KVM_MMU_AUDIT
3664#include "mmu_audit.c" 3655#include "mmu_audit.c"
3656#else
3657static void mmu_audit_disable(void) { }
3665#endif 3658#endif
3659
3660void kvm_mmu_destroy(struct kvm_vcpu *vcpu)
3661{
3662 ASSERT(vcpu);
3663
3664 destroy_kvm_mmu(vcpu);
3665 free_mmu_pages(vcpu);
3666 mmu_free_memory_caches(vcpu);
3667 mmu_audit_disable();
3668}