aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-06-25 06:30:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-25 06:30:21 -0400
commit8b7ef4ec5b1ac8b6feebf5ae9cda85a7514728f8 (patch)
tree8f1f746f98707fb82bcec281ee8f65216eddae36 /arch/x86/xen/enlighten.c
parenta1d5a8691f1b6c92491747bea3b778b184fa5837 (diff)
parent543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff)
Merge branch 'linus' into x86/fixmap
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c56
1 files changed, 23 insertions, 33 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0ad8a64a2e05..2d19382e6555 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -785,38 +785,35 @@ static __init void xen_set_pte_init(pte_t *ptep, pte_t pte)
785static __init void xen_pagetable_setup_start(pgd_t *base) 785static __init void xen_pagetable_setup_start(pgd_t *base)
786{ 786{
787 pgd_t *xen_pgd = (pgd_t *)xen_start_info->pt_base; 787 pgd_t *xen_pgd = (pgd_t *)xen_start_info->pt_base;
788 int i;
788 789
789 /* special set_pte for pagetable initialization */ 790 /* special set_pte for pagetable initialization */
790 pv_mmu_ops.set_pte = xen_set_pte_init; 791 pv_mmu_ops.set_pte = xen_set_pte_init;
791 792
792 init_mm.pgd = base; 793 init_mm.pgd = base;
793 /* 794 /*
794 * copy top-level of Xen-supplied pagetable into place. For 795 * copy top-level of Xen-supplied pagetable into place. This
795 * !PAE we can use this as-is, but for PAE it is a stand-in 796 * is a stand-in while we copy the pmd pages.
796 * while we copy the pmd pages.
797 */ 797 */
798 memcpy(base, xen_pgd, PTRS_PER_PGD * sizeof(pgd_t)); 798 memcpy(base, xen_pgd, PTRS_PER_PGD * sizeof(pgd_t));
799 799
800 if (PTRS_PER_PMD > 1) { 800 /*
801 int i; 801 * For PAE, need to allocate new pmds, rather than
802 /* 802 * share Xen's, since Xen doesn't like pmd's being
803 * For PAE, need to allocate new pmds, rather than 803 * shared between address spaces.
804 * share Xen's, since Xen doesn't like pmd's being 804 */
805 * shared between address spaces. 805 for (i = 0; i < PTRS_PER_PGD; i++) {
806 */ 806 if (pgd_val_ma(xen_pgd[i]) & _PAGE_PRESENT) {
807 for (i = 0; i < PTRS_PER_PGD; i++) { 807 pmd_t *pmd = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
808 if (pgd_val_ma(xen_pgd[i]) & _PAGE_PRESENT) {
809 pmd_t *pmd = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE);
810 808
811 memcpy(pmd, (void *)pgd_page_vaddr(xen_pgd[i]), 809 memcpy(pmd, (void *)pgd_page_vaddr(xen_pgd[i]),
812 PAGE_SIZE); 810 PAGE_SIZE);
813 811
814 make_lowmem_page_readonly(pmd); 812 make_lowmem_page_readonly(pmd);
815 813
816 set_pgd(&base[i], __pgd(1 + __pa(pmd))); 814 set_pgd(&base[i], __pgd(1 + __pa(pmd)));
817 } else 815 } else
818 pgd_clear(&base[i]); 816 pgd_clear(&base[i]);
819 }
820 } 817 }
821 818
822 /* make sure zero_page is mapped RO so we can use it in pagetables */ 819 /* make sure zero_page is mapped RO so we can use it in pagetables */
@@ -873,17 +870,7 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
873 870
874 /* Actually pin the pagetable down, but we can't set PG_pinned 871 /* Actually pin the pagetable down, but we can't set PG_pinned
875 yet because the page structures don't exist yet. */ 872 yet because the page structures don't exist yet. */
876 { 873 pin_pagetable_pfn(MMUEXT_PIN_L3_TABLE, PFN_DOWN(__pa(base)));
877 unsigned level;
878
879#ifdef CONFIG_X86_PAE
880 level = MMUEXT_PIN_L3_TABLE;
881#else
882 level = MMUEXT_PIN_L2_TABLE;
883#endif
884
885 pin_pagetable_pfn(level, PFN_DOWN(__pa(base)));
886 }
887} 874}
888 875
889/* This is called once we have the cpu_possible_map */ 876/* This is called once we have the cpu_possible_map */
@@ -1120,7 +1107,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1120 .make_pte = xen_make_pte, 1107 .make_pte = xen_make_pte,
1121 .make_pgd = xen_make_pgd, 1108 .make_pgd = xen_make_pgd,
1122 1109
1123#ifdef CONFIG_X86_PAE
1124 .set_pte_atomic = xen_set_pte_atomic, 1110 .set_pte_atomic = xen_set_pte_atomic,
1125 .set_pte_present = xen_set_pte_at, 1111 .set_pte_present = xen_set_pte_at,
1126 .set_pud = xen_set_pud, 1112 .set_pud = xen_set_pud,
@@ -1129,7 +1115,6 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1129 1115
1130 .make_pmd = xen_make_pmd, 1116 .make_pmd = xen_make_pmd,
1131 .pmd_val = xen_pmd_val, 1117 .pmd_val = xen_pmd_val,
1132#endif /* PAE */
1133 1118
1134 .activate_mm = xen_activate_mm, 1119 .activate_mm = xen_activate_mm,
1135 .dup_mmap = xen_dup_mmap, 1120 .dup_mmap = xen_dup_mmap,
@@ -1257,6 +1242,11 @@ asmlinkage void __init xen_start_kernel(void)
1257 if (xen_feature(XENFEAT_supervisor_mode_kernel)) 1242 if (xen_feature(XENFEAT_supervisor_mode_kernel))
1258 pv_info.kernel_rpl = 0; 1243 pv_info.kernel_rpl = 0;
1259 1244
1245 /* Prevent unwanted bits from being set in PTEs. */
1246 __supported_pte_mask &= ~_PAGE_GLOBAL;
1247 if (!is_initial_xendomain())
1248 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
1249
1260 /* set the limit of our address space */ 1250 /* set the limit of our address space */
1261 xen_reserve_top(); 1251 xen_reserve_top();
1262 1252