Skip to content

Commit

Permalink
Merge pull request jclulow#2 from richlowe/master
Browse files Browse the repository at this point in the history
Let invlpg invlpg, walk hash list safely in get_page
  • Loading branch information
Joshua M. Clulow committed Sep 11, 2011
2 parents 4196b23 + 0fc5cf7 commit 80e916d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions kvm_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,11 +1874,7 @@ emulator_io_permited(struct x86_emulate_ctxt *ctxt,
int
emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address)
{
#ifdef XXX
kvm_mmu_invlpg(vcpu, address);
#else
XXX_KVM_PROBE;
#endif
return (X86EMUL_CONTINUE);
}

Expand Down
6 changes: 3 additions & 3 deletions kvm_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ kvm_mmu_get_page(struct kvm_vcpu *vcpu, gfn_t gfn, gva_t gaddr, unsigned level,
unsigned index;
unsigned quadrant;
list_t *bucket;
struct kvm_mmu_page *sp;
struct kvm_mmu_page *sp, *nsp = NULL;
struct hlist_node *node, *tmp;

role = vcpu->arch.mmu.base_role;
Expand All @@ -1193,8 +1193,8 @@ kvm_mmu_get_page(struct kvm_vcpu *vcpu, gfn_t gfn, gva_t gaddr, unsigned level,
index = kvm_page_table_hashfn(gfn);
bucket = &vcpu->kvm->arch.mmu_page_hash[index];

for (sp = list_head(bucket); sp != NULL;
sp = list_next(bucket, sp)) {
for (sp = list_head(bucket); sp != NULL; sp = nsp) {
nsp = list_next(bucket, sp);
if (sp->gfn == gfn) {
if (sp->unsync)
if (kvm_sync_page(vcpu, sp))
Expand Down
2 changes: 1 addition & 1 deletion tools/kvm-xxx.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ kvm-xxx
tick-10sec
{
printf("%-12s %-40s %-8s %8s\n", "FILE", "FUNCTION", "LINE", "COUNT");
printa("%20s %8d %@8d\n", @);
printa("%-12s %-40s %-8d %@8d\n", @);
}

0 comments on commit 80e916d

Please sign in to comment.