summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>2011-11-28 20:42:16 +0800
committerAvi Kivity <avi@redhat.com>2011-12-27 11:22:09 +0200
commite459e3228dc57f7160e564ce0f09edb5bee656d3 (patch)
treeaa3b61d28e69a094f0c7906de40c5fcdca38b3d6 /arch/x86/kvm/mmu.c
parent9edb17d55f3ea4943f9654f2aad7a99b4c55840a (diff)
downloadblackbird-op-linux-e459e3228dc57f7160e564ce0f09edb5bee656d3.tar.gz
blackbird-op-linux-e459e3228dc57f7160e564ce0f09edb5bee656d3.zip
KVM: MMU: move the relevant mmu code to mmu.c
Move the mmu code in kvm_arch_vcpu_init() to kvm_mmu_create() Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 62f69dbf6b52..262a3af1f0ec 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3839,7 +3839,11 @@ static int alloc_mmu_pages(struct kvm_vcpu *vcpu)
int kvm_mmu_create(struct kvm_vcpu *vcpu)
{
ASSERT(vcpu);
- ASSERT(!VALID_PAGE(vcpu->arch.mmu.root_hpa));
+
+ vcpu->arch.walk_mmu = &vcpu->arch.mmu;
+ vcpu->arch.mmu.root_hpa = INVALID_PAGE;
+ vcpu->arch.mmu.translate_gpa = translate_gpa;
+ vcpu->arch.nested_mmu.translate_gpa = translate_nested_gpa;
return alloc_mmu_pages(vcpu);
}
OpenPOWER on IntegriCloud