diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-07-26 11:57:04 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-08-23 11:33:30 -0400 |
commit | ae895ed7839f918bbc8d5425b8973b25a534f4eb (patch) | |
tree | 5f1345c10403131981bb0c15e1234f83e9b3f505 /arch | |
parent | 4fac153a7a260e40e10008a0d7a272719684e4cd (diff) |
xen/mmu: use copy_page instead of memcpy.
After all, this is what it is there for.
Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/mmu.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 6ba610098dd9..7247e5a62f27 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1754,14 +1754,14 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) | |||
1754 | * it will be also modified in the __ka space! (But if you just | 1754 | * it will be also modified in the __ka space! (But if you just |
1755 | * modify the PMD table to point to other PTE's or none, then you | 1755 | * modify the PMD table to point to other PTE's or none, then you |
1756 | * are OK - which is what cleanup_highmap does) */ | 1756 | * are OK - which is what cleanup_highmap does) */ |
1757 | memcpy(level2_ident_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD); | 1757 | copy_page(level2_ident_pgt, l2); |
1758 | /* Graft it onto L4[511][511] */ | 1758 | /* Graft it onto L4[511][511] */ |
1759 | memcpy(level2_kernel_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD); | 1759 | copy_page(level2_kernel_pgt, l2); |
1760 | 1760 | ||
1761 | /* Get [511][510] and graft that in level2_fixmap_pgt */ | 1761 | /* Get [511][510] and graft that in level2_fixmap_pgt */ |
1762 | l3 = m2v(pgd[pgd_index(__START_KERNEL_map + PMD_SIZE)].pgd); | 1762 | l3 = m2v(pgd[pgd_index(__START_KERNEL_map + PMD_SIZE)].pgd); |
1763 | l2 = m2v(l3[pud_index(__START_KERNEL_map + PMD_SIZE)].pud); | 1763 | l2 = m2v(l3[pud_index(__START_KERNEL_map + PMD_SIZE)].pud); |
1764 | memcpy(level2_fixmap_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD); | 1764 | copy_page(level2_fixmap_pgt, l2); |
1765 | /* Note that we don't do anything with level1_fixmap_pgt which | 1765 | /* Note that we don't do anything with level1_fixmap_pgt which |
1766 | * we don't need. */ | 1766 | * we don't need. */ |
1767 | 1767 | ||
@@ -1821,8 +1821,7 @@ static void __init xen_write_cr3_init(unsigned long cr3) | |||
1821 | */ | 1821 | */ |
1822 | swapper_kernel_pmd = | 1822 | swapper_kernel_pmd = |
1823 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); | 1823 | extend_brk(sizeof(pmd_t) * PTRS_PER_PMD, PAGE_SIZE); |
1824 | memcpy(swapper_kernel_pmd, initial_kernel_pmd, | 1824 | copy_page(swapper_kernel_pmd, initial_kernel_pmd); |
1825 | sizeof(pmd_t) * PTRS_PER_PMD); | ||
1826 | swapper_pg_dir[KERNEL_PGD_BOUNDARY] = | 1825 | swapper_pg_dir[KERNEL_PGD_BOUNDARY] = |
1827 | __pgd(__pa(swapper_kernel_pmd) | _PAGE_PRESENT); | 1826 | __pgd(__pa(swapper_kernel_pmd) | _PAGE_PRESENT); |
1828 | set_page_prot(swapper_kernel_pmd, PAGE_KERNEL_RO); | 1827 | set_page_prot(swapper_kernel_pmd, PAGE_KERNEL_RO); |
@@ -1851,11 +1850,11 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn) | |||
1851 | 512*1024); | 1850 | 512*1024); |
1852 | 1851 | ||
1853 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); | 1852 | kernel_pmd = m2v(pgd[KERNEL_PGD_BOUNDARY].pgd); |
1854 | memcpy(initial_kernel_pmd, kernel_pmd, sizeof(pmd_t) * PTRS_PER_PMD); | 1853 | copy_page(initial_kernel_pmd, kernel_pmd); |
1855 | 1854 | ||
1856 | xen_map_identity_early(initial_kernel_pmd, max_pfn); | 1855 | xen_map_identity_early(initial_kernel_pmd, max_pfn); |
1857 | 1856 | ||
1858 | memcpy(initial_page_table, pgd, sizeof(pgd_t) * PTRS_PER_PGD); | 1857 | copy_page(initial_page_table, pgd); |
1859 | initial_page_table[KERNEL_PGD_BOUNDARY] = | 1858 | initial_page_table[KERNEL_PGD_BOUNDARY] = |
1860 | __pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT); | 1859 | __pgd(__pa(initial_kernel_pmd) | _PAGE_PRESENT); |
1861 | 1860 | ||