/[pkg-src]/trunk/kernel26-xen/patches-2.6.25-r1/1075-2.6.25-xen-Pull-xen_finish_init_mappin-from-XS-upstream.patch |
Annotation of /trunk/kernel26-xen/patches-2.6.25-r1/1075-2.6.25-xen-Pull-xen_finish_init_mappin-from-XS-upstream.patch
Parent Directory | Revision Log
Revision 606 -
(hide annotations)
(download)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 3500 byte(s)
Thu May 22 23:13:13 2008 UTC (16 years ago) by niro
File size: 3500 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | niro | 606 | From ea5a2b76fa368394de92f851124e347a649e6980 Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> | ||
3 | Date: Wed, 23 Jan 2008 13:20:18 -0200 | ||
4 | Subject: [PATCH] Pull xen_finish_init_mappin() from XS upstream | ||
5 | |||
6 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> | ||
7 | --- | ||
8 | arch/x86/mm/init_64.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++- | ||
9 | 1 files changed, 85 insertions(+), 1 deletions(-) | ||
10 | |||
11 | diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c | ||
12 | index fddf208..58ae6ad 100644 | ||
13 | --- a/arch/x86/mm/init_64.c | ||
14 | +++ b/arch/x86/mm/init_64.c | ||
15 | @@ -468,6 +468,85 @@ int make_readonly(unsigned long paddr) | ||
16 | return readonly; | ||
17 | } | ||
18 | |||
19 | +static void xen_finish_init_mapping(void) | ||
20 | +{ | ||
21 | + /*FIXME: move this to pvops */ | ||
22 | + unsigned long i, start, end; | ||
23 | + | ||
24 | + xprintk("messing with start_info:\n"); | ||
25 | + | ||
26 | + /* Re-vector virtual addresses pointing into the initial | ||
27 | + mapping to the just-established permanent ones. */ | ||
28 | + xen_start_info = __va(__pa(xen_start_info)); | ||
29 | + xen_start_info->pt_base = (unsigned long) | ||
30 | + __va(__pa(xen_start_info->pt_base)); | ||
31 | + if (!xen_feature(XENFEAT_auto_translated_physmap)) { | ||
32 | + phys_to_machine_mapping = | ||
33 | + __va(__pa(xen_start_info->mfn_list)); | ||
34 | + xen_start_info->mfn_list = (unsigned long) | ||
35 | + phys_to_machine_mapping; | ||
36 | + } | ||
37 | + if (xen_start_info->mod_start) | ||
38 | + xen_start_info->mod_start = (unsigned long) | ||
39 | + __va(__pa(xen_start_info->mod_start)); | ||
40 | + | ||
41 | + xprintk("messed with start_info.\n"); | ||
42 | + xprintk("unmapping:\n"); | ||
43 | + | ||
44 | + /* Destroy the Xen-created mappings beyond the kernel image as | ||
45 | + * well as the temporary mappings created above. Prevents | ||
46 | + * overlap with modules area (if init mapping is very big). | ||
47 | + */ | ||
48 | + start = PAGE_ALIGN((unsigned long)_end); | ||
49 | + end = __START_KERNEL_map + (table_end << PAGE_SHIFT); | ||
50 | + | ||
51 | + xprintk("from %lx to %lx\n", start, end); | ||
52 | + for (; start < end; start += PAGE_SIZE) | ||
53 | + WARN_ON(HYPERVISOR_update_va_mapping( | ||
54 | + start, __pte_ma(0), 0)); | ||
55 | + | ||
56 | + /* Allocate pte's for initial fixmaps from 'start_pfn' allocator. */ | ||
57 | + table_end = ~0UL; | ||
58 | + | ||
59 | + | ||
60 | + xprintk("set_fixmaps:\n"); | ||
61 | + | ||
62 | + /* | ||
63 | + * Prefetch pte's for the bt_ioremap() area. It gets used before the | ||
64 | + * boot-time allocator is online, so allocate-on-demand would fail. | ||
65 | + */ | ||
66 | + for (i = FIX_BTMAP_END; i <= FIX_BTMAP_BEGIN; i++) | ||
67 | + clear_fixmap(i); | ||
68 | + | ||
69 | + xprintk("btmap end.\n"); | ||
70 | + | ||
71 | + /* Switch to the real shared_info page, and clear the dummy page. */ | ||
72 | +#if 0 | ||
73 | + set_fixmap_mfn(FIX_SHARED_INFO, xen_start_info->shared_info); | ||
74 | + HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); | ||
75 | +#endif | ||
76 | + | ||
77 | + memset(empty_zero_page, 0, sizeof(empty_zero_page)); | ||
78 | + xprintk("isamaps:\n"); | ||
79 | + | ||
80 | + /* Set up mapping of lowest 1MB of physical memory. */ | ||
81 | + for (i = 0; i < NR_FIX_ISAMAPS; i++) | ||
82 | + if (is_initial_xendomain()) | ||
83 | + __native_set_fixmap(FIX_ISAMAP_BEGIN - i, | ||
84 | + mfn_pte(i * PAGE_SIZE, PAGE_KERNEL)); | ||
85 | + else | ||
86 | + __native_set_fixmap(FIX_ISAMAP_BEGIN - i, | ||
87 | + pfn_pte(__pa(empty_zero_page) | ||
88 | + >> PAGE_SHIFT, | ||
89 | + PAGE_KERNEL_RO)); | ||
90 | + | ||
91 | + /* Disable the 'start_pfn' allocator. */ | ||
92 | + table_end = start_pfn; | ||
93 | + | ||
94 | + xprintk("finished!\n"); | ||
95 | +} | ||
96 | + | ||
97 | + | ||
98 | #else /* !XEN */ | ||
99 | |||
100 | static __meminit void *alloc_low_page(unsigned long *phys) | ||
101 | @@ -771,8 +850,13 @@ void __init_refok init_memory_mapping(unsigned long start, unsigned long end) | ||
102 | unmap_low_page(pud); | ||
103 | } | ||
104 | |||
105 | - if (!after_bootmem) | ||
106 | + if (!after_bootmem) { | ||
107 | +#ifdef CONFIG_XEN | ||
108 | + BUG_ON(start_pfn != table_end); | ||
109 | + xen_finish_init_mapping(); | ||
110 | +#endif | ||
111 | mmu_cr4_features = read_cr4(); | ||
112 | + } | ||
113 | __flush_tlb_all(); | ||
114 | |||
115 | if (!after_bootmem) | ||
116 | -- | ||
117 | 1.5.4.1 | ||
118 |