ia64/xen-unstable

view xen/arch/x86/machine_kexec.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 7dfc0a20fa59
children
line source
1 /******************************************************************************
2 * machine_kexec.c
3 *
4 * Xen port written by:
5 * - Simon 'Horms' Horman <horms@verge.net.au>
6 * - Magnus Damm <magnus@valinux.co.jp>
7 */
9 #include <xen/lib.h>
10 #include <asm/irq.h>
11 #include <asm/page.h>
12 #include <asm/flushtlb.h>
13 #include <xen/smp.h>
14 #include <xen/nmi.h>
15 #include <xen/types.h>
16 #include <xen/console.h>
17 #include <xen/kexec.h>
18 #include <xen/domain_page.h>
19 #include <asm/fixmap.h>
20 #include <asm/hvm/hvm.h>
22 typedef void (*relocate_new_kernel_t)(
23 unsigned long indirection_page,
24 unsigned long *page_list,
25 unsigned long start_address);
27 extern int machine_kexec_get_xen(xen_kexec_range_t *range);
30 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image)
31 {
32 unsigned long prev_ma = 0;
33 int fix_base = FIX_KEXEC_BASE_0 + (slot * (KEXEC_XEN_NO_PAGES >> 1));
34 int k;
36 /* setup fixmap to point to our pages and record the virtual address
37 * in every odd index in page_list[].
38 */
40 for ( k = 0; k < KEXEC_XEN_NO_PAGES; k++ )
41 {
42 if ( (k & 1) == 0 )
43 {
44 /* Even pages: machine address. */
45 prev_ma = image->page_list[k];
46 }
47 else
48 {
49 /* Odd pages: va for previous ma. */
50 if ( is_pv_32on64_domain(dom0) )
51 {
52 /*
53 * The compatability bounce code sets up a page table
54 * with a 1-1 mapping of the first 1G of memory so
55 * VA==PA here.
56 *
57 * This Linux purgatory code still sets up separate
58 * high and low mappings on the control page (entries
59 * 0 and 1) but it is harmless if they are equal since
60 * that PT is not live at the time.
61 */
62 image->page_list[k] = prev_ma;
63 }
64 else
65 {
66 set_fixmap(fix_base + (k >> 1), prev_ma);
67 image->page_list[k] = fix_to_virt(fix_base + (k >> 1));
68 }
69 }
70 }
72 return 0;
73 }
75 void machine_kexec_unload(int type, int slot, xen_kexec_image_t *image)
76 {
77 }
79 static void __machine_reboot_kexec(void *data)
80 {
81 xen_kexec_image_t *image = (xen_kexec_image_t *)data;
83 watchdog_disable();
84 console_start_sync();
86 smp_send_stop();
88 machine_kexec(image);
89 }
91 void machine_reboot_kexec(xen_kexec_image_t *image)
92 {
93 int reboot_cpu_id;
95 reboot_cpu_id = 0;
97 if ( !cpu_isset(reboot_cpu_id, cpu_online_map) )
98 reboot_cpu_id = smp_processor_id();
100 if ( reboot_cpu_id != smp_processor_id() )
101 {
102 on_selected_cpus(cpumask_of(reboot_cpu_id), __machine_reboot_kexec,
103 image, 0);
104 for (;;)
105 ; /* nothing */
106 }
107 else
108 {
109 __machine_reboot_kexec(image);
110 }
111 BUG();
112 }
114 void machine_kexec(xen_kexec_image_t *image)
115 {
116 #ifdef CONFIG_COMPAT
117 if ( is_pv_32on64_domain(dom0) )
118 {
119 extern void compat_machine_kexec(unsigned long rnk,
120 unsigned long indirection_page,
121 unsigned long *page_list,
122 unsigned long start_address);
123 compat_machine_kexec(image->page_list[1],
124 image->indirection_page,
125 image->page_list,
126 image->start_address);
127 }
128 else
129 #endif
130 {
131 relocate_new_kernel_t rnk;
133 rnk = (relocate_new_kernel_t) image->page_list[1];
134 (*rnk)(image->indirection_page, image->page_list,
135 image->start_address);
136 }
137 }
139 int machine_kexec_get(xen_kexec_range_t *range)
140 {
141 if (range->range != KEXEC_RANGE_MA_XEN)
142 return -EINVAL;
143 return machine_kexec_get_xen(range);
144 }
146 void arch_crash_save_vmcoreinfo(void)
147 {
148 VMCOREINFO_SYMBOL(dom_xen);
149 VMCOREINFO_SYMBOL(dom_io);
151 #ifdef CONFIG_X86_32
152 VMCOREINFO_SYMBOL(xenheap_phys_end);
153 #endif
154 #ifdef CONFIG_X86_PAE
155 VMCOREINFO_SYMBOL_ALIAS(pgd_l3, idle_pg_table);
156 #endif
157 #ifdef CONFIG_X86_64
158 VMCOREINFO_SYMBOL_ALIAS(pgd_l4, idle_pg_table);
159 #endif
160 }
162 /*
163 * Local variables:
164 * mode: C
165 * c-set-style: "BSD"
166 * c-basic-offset: 4
167 * tab-width: 4
168 * indent-tabs-mode: nil
169 * End:
170 */