提交 6292757f 编写于 作者: X Xiao Guangrong 提交者: Avi Kivity

KVM: MMU: update 'root_hpa' out of loop in PAE shadow path

The value of 'vcpu->arch.mmu.pae_root' is not modified, so we can update
'root_hpa' out of the loop.
Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 7129eeca
...@@ -2393,8 +2393,8 @@ static int mmu_alloc_direct_roots(struct kvm_vcpu *vcpu) ...@@ -2393,8 +2393,8 @@ static int mmu_alloc_direct_roots(struct kvm_vcpu *vcpu)
++sp->root_count; ++sp->root_count;
spin_unlock(&vcpu->kvm->mmu_lock); spin_unlock(&vcpu->kvm->mmu_lock);
vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK; 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 } else
BUG(); BUG();
...@@ -2466,8 +2466,8 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu) ...@@ -2466,8 +2466,8 @@ static int mmu_alloc_shadow_roots(struct kvm_vcpu *vcpu)
spin_unlock(&vcpu->kvm->mmu_lock); spin_unlock(&vcpu->kvm->mmu_lock);
vcpu->arch.mmu.pae_root[i] = root | pm_mask; 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 * If we shadow a 32 bit page table with a long mode page
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册