diff options
Diffstat (limited to 'drivers/kvm/paging_tmpl.h')
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 99ac9b15f773..be0f85231da9 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -238,7 +238,12 @@ static void FNAME(set_pte_common)(struct kvm_vcpu *vcpu, | |||
238 | FNAME(mark_pagetable_dirty)(vcpu->kvm, walker); | 238 | FNAME(mark_pagetable_dirty)(vcpu->kvm, walker); |
239 | } | 239 | } |
240 | 240 | ||
241 | spte = PT_PRESENT_MASK | PT_ACCESSED_MASK | PT_DIRTY_MASK; | 241 | /* |
242 | * We don't set the accessed bit, since we sometimes want to see | ||
243 | * whether the guest actually used the pte (in order to detect | ||
244 | * demand paging). | ||
245 | */ | ||
246 | spte = PT_PRESENT_MASK | PT_DIRTY_MASK; | ||
242 | spte |= gpte & PT64_NX_MASK; | 247 | spte |= gpte & PT64_NX_MASK; |
243 | if (!dirty) | 248 | if (!dirty) |
244 | access_bits &= ~PT_WRITABLE_MASK; | 249 | access_bits &= ~PT_WRITABLE_MASK; |
@@ -291,6 +296,8 @@ unshadowed: | |||
291 | page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); | 296 | page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); |
292 | if (!was_rmapped) | 297 | if (!was_rmapped) |
293 | rmap_add(vcpu, shadow_pte); | 298 | rmap_add(vcpu, shadow_pte); |
299 | if (!ptwrite || !*ptwrite) | ||
300 | vcpu->last_pte_updated = shadow_pte; | ||
294 | } | 301 | } |
295 | 302 | ||
296 | static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t gpte, | 303 | static void FNAME(set_pte)(struct kvm_vcpu *vcpu, pt_element_t gpte, |