Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315896
b: refs/heads/master
c: 2f84569
h: refs/heads/master
v: v3
  • Loading branch information
Xiao Guangrong authored and Avi Kivity committed Jul 11, 2012
1 parent 4e0ddfe commit 84928e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: a27685c33acccce91268ddef88d7896e3205fda5
refs/heads/master: 2f84569f978cd7d54970d893b4c4e68ef24dc1ec
13 changes: 7 additions & 6 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,12 @@ static void drop_spte(struct kvm *kvm, u64 *sptep)
rmap_remove(kvm, sptep);
}

static int __rmap_write_protect(struct kvm *kvm, unsigned long *rmapp, int level)
static bool
__rmap_write_protect(struct kvm *kvm, unsigned long *rmapp, int level)
{
u64 *sptep;
struct rmap_iterator iter;
int write_protected = 0;
bool write_protected = false;

for (sptep = rmap_get_first(*rmapp, &iter); sptep;) {
BUG_ON(!(*sptep & PT_PRESENT_MASK));
Expand All @@ -1075,7 +1076,7 @@ static int __rmap_write_protect(struct kvm *kvm, unsigned long *rmapp, int level
sptep = rmap_get_first(*rmapp, &iter);
}

write_protected = 1;
write_protected = true;
}

return write_protected;
Expand Down Expand Up @@ -1106,12 +1107,12 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
}
}

static int rmap_write_protect(struct kvm *kvm, u64 gfn)
static bool rmap_write_protect(struct kvm *kvm, u64 gfn)
{
struct kvm_memory_slot *slot;
unsigned long *rmapp;
int i;
int write_protected = 0;
bool write_protected = false;

slot = gfn_to_memslot(kvm, gfn);

Expand Down Expand Up @@ -1700,7 +1701,7 @@ static void mmu_sync_children(struct kvm_vcpu *vcpu,

kvm_mmu_pages_init(parent, &parents, &pages);
while (mmu_unsync_walk(parent, &pages)) {
int protected = 0;
bool protected = false;

for_each_sp(pages, sp, parents, i)
protected |= rmap_write_protect(vcpu->kvm, sp->gfn);
Expand Down

0 comments on commit 84928e5

Please sign in to comment.