diff options
author | Xiao Guangrong | 2011-03-04 11:58:02 +0100 |
---|---|---|
committer | Marcelo Tosatti | 2011-03-17 17:08:32 +0100 |
commit | 1b7fd45c32fcc170246bf10ba8d33871840319b8 (patch) | |
tree | 73b4b7a80ff48f47afdd2d08794bf14d13335131 | |
parent | KVM: MMU: fix kvm_mmu_slot_remove_write_access dropping intermediate W bits (diff) | |
download | kernel-qcow2-linux-1b7fd45c32fcc170246bf10ba8d33871840319b8.tar.gz kernel-qcow2-linux-1b7fd45c32fcc170246bf10ba8d33871840319b8.tar.xz kernel-qcow2-linux-1b7fd45c32fcc170246bf10ba8d33871840319b8.zip |
KVM: MMU: set spte accessed bit properly
Set spte accessed bit only if guest_initiated == 1 that means the really
accessed
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b9bf016d7f0f..d5455b1b725f 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3307,11 +3307,11 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, spin_lock(&vcpu->kvm->mmu_lock); if (atomic_read(&vcpu->kvm->arch.invlpg_counter) != invlpg_counter) gentry = 0; - kvm_mmu_access_page(vcpu, gfn); kvm_mmu_free_some_pages(vcpu); ++vcpu->kvm->stat.mmu_pte_write; trace_kvm_mmu_audit(vcpu, AUDIT_PRE_PTE_WRITE); if (guest_initiated) { + kvm_mmu_access_page(vcpu, gfn); if (gfn == vcpu->arch.last_pt_write_gfn && !last_updated_pte_accessed(vcpu)) { ++vcpu->arch.last_pt_write_count; |