Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329795
b: refs/heads/master
c: f395302
h: refs/heads/master
i:
  329793: 50857f7
  329791: 97751af
v: v3
  • Loading branch information
Takuya Yoshikawa authored and Marcelo Tosatti committed Jul 18, 2012
1 parent 3af46c4 commit 83cb479
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 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: 048212d0bc0b1769a4bbecd7ace8c8d237577d1b
refs/heads/master: f395302e09ef783b8f82d1160510a95aa8c66dbc
23 changes: 10 additions & 13 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,8 +1269,7 @@ static int kvm_handle_hva_range(struct kvm *kvm,
unsigned long data))
{
int j;
int ret;
int retval = 0;
int ret = 0;
struct kvm_memslots *slots;
struct kvm_memory_slot *memslot;

Expand All @@ -1293,23 +1292,17 @@ static int kvm_handle_hva_range(struct kvm *kvm,
gfn_end = hva_to_gfn_memslot(hva_end + PAGE_SIZE - 1, memslot);

for (; gfn < gfn_end; ++gfn) {
ret = 0;

for (j = PT_PAGE_TABLE_LEVEL;
j < PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES; ++j) {
unsigned long *rmapp;

rmapp = __gfn_to_rmap(gfn, j, memslot);
ret |= handler(kvm, rmapp, memslot, data);
}
trace_kvm_age_page(memslot->userspace_addr +
(gfn - memslot->base_gfn) * PAGE_SIZE,
memslot, ret);
retval |= ret;
}
}

return retval;
return ret;
}

static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
Expand Down Expand Up @@ -1351,8 +1344,10 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
* This has some overhead, but not as much as the cost of swapping
* out actively used pages or breaking up actively used hugepages.
*/
if (!shadow_accessed_mask)
return kvm_unmap_rmapp(kvm, rmapp, slot, data);
if (!shadow_accessed_mask) {
young = kvm_unmap_rmapp(kvm, rmapp, slot, data);
goto out;
}

for (sptep = rmap_get_first(*rmapp, &iter); sptep;
sptep = rmap_get_next(&iter)) {
Expand All @@ -1364,7 +1359,9 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
(unsigned long *)sptep);
}
}

out:
/* @data has hva passed to kvm_age_hva(). */
trace_kvm_age_page(data, slot, young);
return young;
}

Expand Down Expand Up @@ -1413,7 +1410,7 @@ static void rmap_recycle(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)

int kvm_age_hva(struct kvm *kvm, unsigned long hva)
{
return kvm_handle_hva(kvm, hva, 0, kvm_age_rmapp);
return kvm_handle_hva(kvm, hva, hva, kvm_age_rmapp);
}

int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
Expand Down

0 comments on commit 83cb479

Please sign in to comment.