Skip to content

Commit

Permalink
KVM: MMU: update 'root_hpa' out of loop in PAE shadow path
Browse files Browse the repository at this point in the history
The value of 'vcpu->arch.mmu.pae_root' is not modified, so we can update
'root_hpa' out of the loop.

Signed-off-by: Xiao Guangrong <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
Xiao Guangrong authored and avikivity committed Oct 24, 2010
1 parent 7129eec commit 6292757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2393,8 +2393,8 @@ static int mmu_alloc_direct_roots(struct kvm_vcpu *vcpu)
++sp->root_count;
spin_unlock(&vcpu->kvm->mmu_lock);
vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK;
vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
}
vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
} else
BUG();

Expand Down Expand Up @@ -2466,8 +2466,8 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu)
spin_unlock(&vcpu->kvm->mmu_lock);

vcpu->arch.mmu.pae_root[i] = root | pm_mask;
vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
}
vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);

/*
* If we shadow a 32 bit page table with a long mode page
Expand Down

0 comments on commit 6292757

Please sign in to comment.