diff options
author | Sheng Yang <sheng@linux.intel.com> | 2010-05-12 04:40:41 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 03:35:44 -0400 |
commit | 62ad07551a2ace89e35604d1c55fdae1dd3359a8 (patch) | |
tree | fa62d906a519406340b93f692f503655b2602b1c /arch/x86/kvm/mmu.c | |
parent | 222b7c52c33bdef721248bfeba992af495800d30 (diff) |
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 a455c5eee370..c075542648cd 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) | |||
2478 | static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) | 2478 | static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) |
2479 | { | 2479 | { |
2480 | ASSERT(vcpu); | 2480 | ASSERT(vcpu); |
2481 | if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) { | 2481 | if (VALID_PAGE(vcpu->arch.mmu.root_hpa)) |
2482 | /* mmu.free() should set root_hpa = INVALID_PAGE */ | ||
2482 | vcpu->arch.mmu.free(vcpu); | 2483 | vcpu->arch.mmu.free(vcpu); |
2483 | vcpu->arch.mmu.root_hpa = INVALID_PAGE; | ||
2484 | } | ||
2485 | } | 2484 | } |
2486 | 2485 | ||
2487 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) | 2486 | int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) |