diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2010-12-06 21:34:42 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:30:40 -0500 |
commit | 2ec4739ddc889af11d09b3d5ca33687f1f3f1020 (patch) | |
tree | 880bdaa04f0454cccbb9786eb8cd22e8309d44b8 /arch/x86/kvm/mmu.c | |
parent | 78b2c54aa4a7e9e4257d2b8e3a4b96d2d0c6e636 (diff) |
KVM: MMU: fix accessed bit set on prefault path
Retry #PF is the speculative path, so don't set the accessed bit
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 83d45cf0a61c..d475b6b87dce 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2214,7 +2214,8 @@ static void direct_pte_prefetch(struct kvm_vcpu *vcpu, u64 *sptep) | |||
2214 | } | 2214 | } |
2215 | 2215 | ||
2216 | static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | 2216 | static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, |
2217 | int map_writable, int level, gfn_t gfn, pfn_t pfn) | 2217 | int map_writable, int level, gfn_t gfn, pfn_t pfn, |
2218 | bool prefault) | ||
2218 | { | 2219 | { |
2219 | struct kvm_shadow_walk_iterator iterator; | 2220 | struct kvm_shadow_walk_iterator iterator; |
2220 | struct kvm_mmu_page *sp; | 2221 | struct kvm_mmu_page *sp; |
@@ -2229,7 +2230,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | |||
2229 | pte_access &= ~ACC_WRITE_MASK; | 2230 | pte_access &= ~ACC_WRITE_MASK; |
2230 | mmu_set_spte(vcpu, iterator.sptep, ACC_ALL, pte_access, | 2231 | mmu_set_spte(vcpu, iterator.sptep, ACC_ALL, pte_access, |
2231 | 0, write, 1, &pt_write, | 2232 | 0, write, 1, &pt_write, |
2232 | level, gfn, pfn, false, map_writable); | 2233 | level, gfn, pfn, prefault, map_writable); |
2233 | direct_pte_prefetch(vcpu, iterator.sptep); | 2234 | direct_pte_prefetch(vcpu, iterator.sptep); |
2234 | ++vcpu->stat.pf_fixed; | 2235 | ++vcpu->stat.pf_fixed; |
2235 | break; | 2236 | break; |
@@ -2321,7 +2322,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, int write, gfn_t gfn, | |||
2321 | if (mmu_notifier_retry(vcpu, mmu_seq)) | 2322 | if (mmu_notifier_retry(vcpu, mmu_seq)) |
2322 | goto out_unlock; | 2323 | goto out_unlock; |
2323 | kvm_mmu_free_some_pages(vcpu); | 2324 | kvm_mmu_free_some_pages(vcpu); |
2324 | r = __direct_map(vcpu, v, write, map_writable, level, gfn, pfn); | 2325 | r = __direct_map(vcpu, v, write, map_writable, level, gfn, pfn, |
2326 | prefault); | ||
2325 | spin_unlock(&vcpu->kvm->mmu_lock); | 2327 | spin_unlock(&vcpu->kvm->mmu_lock); |
2326 | 2328 | ||
2327 | 2329 | ||
@@ -2685,7 +2687,7 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code, | |||
2685 | goto out_unlock; | 2687 | goto out_unlock; |
2686 | kvm_mmu_free_some_pages(vcpu); | 2688 | kvm_mmu_free_some_pages(vcpu); |
2687 | r = __direct_map(vcpu, gpa, write, map_writable, | 2689 | r = __direct_map(vcpu, gpa, write, map_writable, |
2688 | level, gfn, pfn); | 2690 | level, gfn, pfn, prefault); |
2689 | spin_unlock(&vcpu->kvm->mmu_lock); | 2691 | spin_unlock(&vcpu->kvm->mmu_lock); |
2690 | 2692 | ||
2691 | return r; | 2693 | return r; |