Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221646
b: refs/heads/master
c: eb45fda
h: refs/heads/master
v: v3
  • Loading branch information
Marcelo Tosatti committed Nov 5, 2010
1 parent f65fe3a commit 1c15c06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: edde99ce05290e50ce0b3495d209e54e6349ab47
refs/heads/master: eb45fda45f915c7ca3e81e005e853cb770da2642
9 changes: 5 additions & 4 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ static void rmap_remove(struct kvm *kvm, u64 *spte)
}
}

static void set_spte_track_bits(u64 *sptep, u64 new_spte)
static int set_spte_track_bits(u64 *sptep, u64 new_spte)
{
pfn_t pfn;
u64 old_spte = *sptep;
Expand All @@ -731,19 +731,20 @@ static void set_spte_track_bits(u64 *sptep, u64 new_spte)
old_spte = __xchg_spte(sptep, new_spte);

if (!is_rmap_spte(old_spte))
return;
return 0;

pfn = spte_to_pfn(old_spte);
if (!shadow_accessed_mask || old_spte & shadow_accessed_mask)
kvm_set_pfn_accessed(pfn);
if (!shadow_dirty_mask || (old_spte & shadow_dirty_mask))
kvm_set_pfn_dirty(pfn);
return 1;
}

static void drop_spte(struct kvm *kvm, u64 *sptep, u64 new_spte)
{
set_spte_track_bits(sptep, new_spte);
rmap_remove(kvm, sptep);
if (set_spte_track_bits(sptep, new_spte))
rmap_remove(kvm, sptep);
}

static u64 *rmap_next(struct kvm *kvm, unsigned long *rmapp, u64 *spte)
Expand Down

0 comments on commit 1c15c06

Please sign in to comment.