diff options
author | Sheng Yang <sheng@linux.intel.com> | 2010-05-12 08:40:41 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 07:35:44 (GMT) |
commit | 62ad07551a2ace89e35604d1c55fdae1dd3359a8 (patch) | |
tree | fa62d906a519406340b93f692f503655b2602b1c /arch/x86/kvm/mmu.c | |
parent | 222b7c52c33bdef721248bfeba992af495800d30 (diff) | |
download | linux-fsl-qoriq-62ad07551a2ace89e35604d1c55fdae1dd3359a8.tar.xz |
KVM: x86: Clean up duplicate assignment
mmu.free() already set root_hpa to INVALID_PAGE, no need to do it again in the
destory_kvm_mmu().
kvm_x86_ops->set_cr4() and set_efer() already assign cr4/efer to
vcpu->arch.cr4/efer, no need to do it again later.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a455c5e..c075542 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2478,10 +2478,9 @@ static int init_kvm_mmu(struct kvm_vcpu *vcpu) static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) { ASSERT(vcpu); - if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) { + if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) + /* mmu.free() should set root_hpa = INVALID_PAGE */ vcpu->arch.mmu.free(vcpu); - vcpu->arch.mmu.root_hpa = INVALID_PAGE; - } } int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) |