aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/mmu.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2007-01-05 19:36:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:28 -0500
commit68a99f6d37aa65e848e09ec6ea52848e93bd5de2 (patch)
tree28f9da432eb33364a17389dc3ce994269318837f /drivers/kvm/mmu.c
parentd21225ee2b6fa9f7669526927f2e0bedebd90940 (diff)
[PATCH] KVM: Simplify mmu_alloc_roots()
Small optimization/cleanup: page == page_header(page->page_hpa) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r--drivers/kvm/mmu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 4118e504e647..c6f972914f08 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -820,9 +820,9 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
820 hpa_t root = vcpu->mmu.root_hpa; 820 hpa_t root = vcpu->mmu.root_hpa;
821 821
822 ASSERT(!VALID_PAGE(root)); 822 ASSERT(!VALID_PAGE(root));
823 root = kvm_mmu_get_page(vcpu, root_gfn, 0, 823 page = kvm_mmu_get_page(vcpu, root_gfn, 0,
824 PT64_ROOT_LEVEL, 0, NULL)->page_hpa; 824 PT64_ROOT_LEVEL, 0, NULL);
825 page = page_header(root); 825 root = page->page_hpa;
826 ++page->root_count; 826 ++page->root_count;
827 vcpu->mmu.root_hpa = root; 827 vcpu->mmu.root_hpa = root;
828 return; 828 return;
@@ -836,10 +836,10 @@ static void mmu_alloc_roots(struct kvm_vcpu *vcpu)
836 root_gfn = vcpu->pdptrs[i] >> PAGE_SHIFT; 836 root_gfn = vcpu->pdptrs[i] >> PAGE_SHIFT;
837 else if (vcpu->mmu.root_level == 0) 837 else if (vcpu->mmu.root_level == 0)
838 root_gfn = 0; 838 root_gfn = 0;
839 root = kvm_mmu_get_page(vcpu, root_gfn, i << 30, 839 page = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
840 PT32_ROOT_LEVEL, !is_paging(vcpu), 840 PT32_ROOT_LEVEL, !is_paging(vcpu),
841 NULL)->page_hpa; 841 NULL);
842 page = page_header(root); 842 root = page->page_hpa;
843 ++page->root_count; 843 ++page->root_count;
844 vcpu->mmu.pae_root[i] = root | PT_PRESENT_MASK; 844 vcpu->mmu.pae_root[i] = root | PT_PRESENT_MASK;
845 } 845 }