diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2010-08-28 07:22:46 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:51:47 -0400 |
commit | bc32ce2152406431acf4daf4a81dc1664bb7b91b (patch) | |
tree | ae2f6737d56c8d977485489d58d08b3528fd2d6e /arch/x86/kvm/paging_tmpl.h | |
parent | 0beb8d660425aab339ff68e6f4d4528739e8fc4f (diff) |
KVM: MMU: fix wrong not write protected sp report
The audit code reports some sp not write protected in current code, it's just the
bug in audit_write_protection(), since:
- the invalid sp not need write protected
- using uninitialize local variable('gfn')
- call kvm_mmu_audit() out of mmu_lock's protection
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index a4e8389df2ad..a0f2febf5692 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -504,7 +504,6 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
504 | unsigned long mmu_seq; | 504 | unsigned long mmu_seq; |
505 | 505 | ||
506 | pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code); | 506 | pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code); |
507 | kvm_mmu_audit(vcpu, "pre page fault"); | ||
508 | 507 | ||
509 | r = mmu_topup_memory_caches(vcpu); | 508 | r = mmu_topup_memory_caches(vcpu); |
510 | if (r) | 509 | if (r) |
@@ -542,6 +541,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, | |||
542 | spin_lock(&vcpu->kvm->mmu_lock); | 541 | spin_lock(&vcpu->kvm->mmu_lock); |
543 | if (mmu_notifier_retry(vcpu, mmu_seq)) | 542 | if (mmu_notifier_retry(vcpu, mmu_seq)) |
544 | goto out_unlock; | 543 | goto out_unlock; |
544 | |||
545 | kvm_mmu_audit(vcpu, "pre page fault"); | ||
545 | kvm_mmu_free_some_pages(vcpu); | 546 | kvm_mmu_free_some_pages(vcpu); |
546 | sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault, | 547 | sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault, |
547 | level, &write_pt, pfn); | 548 | level, &write_pt, pfn); |