Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>

authored by

Ingo Molnar and committed by
Linus Torvalds
68a99f6d d21225ee

+6 -6
+6 -6
drivers/kvm/mmu.c
··· 820 820 hpa_t root = vcpu->mmu.root_hpa; 821 821 822 822 ASSERT(!VALID_PAGE(root)); 823 - root = kvm_mmu_get_page(vcpu, root_gfn, 0, 824 - PT64_ROOT_LEVEL, 0, NULL)->page_hpa; 825 - page = page_header(root); 823 + page = kvm_mmu_get_page(vcpu, root_gfn, 0, 824 + PT64_ROOT_LEVEL, 0, NULL); 825 + root = page->page_hpa; 826 826 ++page->root_count; 827 827 vcpu->mmu.root_hpa = root; 828 828 return; ··· 836 836 root_gfn = vcpu->pdptrs[i] >> PAGE_SHIFT; 837 837 else if (vcpu->mmu.root_level == 0) 838 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 840 PT32_ROOT_LEVEL, !is_paging(vcpu), 841 - NULL)->page_hpa; 842 - page = page_header(root); 841 + NULL); 842 + root = page->page_hpa; 843 843 ++page->root_count; 844 844 vcpu->mmu.pae_root[i] = root | PT_PRESENT_MASK; 845 845 }