diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-10-16 22:17:59 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-10-17 13:02:52 -0400 |
commit | b5a26e4db818d4647a019d5c462f6778b8213112 (patch) | |
tree | c846b01afef803767351e49d9a9218a89933fe66 /arch/ia64/xen/xen_pv_ops.c | |
parent | 080104cd0f708b6bb5a121922801867a29ad63fc (diff) |
ia64/pv_ops/xen: define xen pv_init_ops for various xen initialization.
This patch implements xen version of pv_init_ops to do various
xen initialization.
This patch also includes ia64 counter part of x86 xen early printk support
patches.
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/xen/xen_pv_ops.c')
-rw-r--r-- | arch/ia64/xen/xen_pv_ops.c | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c index 77db214b116c..fc9d599b62ae 100644 --- a/arch/ia64/xen/xen_pv_ops.c +++ b/arch/ia64/xen/xen_pv_ops.c | |||
@@ -54,6 +54,115 @@ xen_info_init(void) | |||
54 | } | 54 | } |
55 | 55 | ||
56 | /*************************************************************************** | 56 | /*************************************************************************** |
57 | * pv_init_ops | ||
58 | * initialization hooks. | ||
59 | */ | ||
60 | |||
61 | static void | ||
62 | xen_panic_hypercall(struct unw_frame_info *info, void *arg) | ||
63 | { | ||
64 | current->thread.ksp = (__u64)info->sw - 16; | ||
65 | HYPERVISOR_shutdown(SHUTDOWN_crash); | ||
66 | /* we're never actually going to get here... */ | ||
67 | } | ||
68 | |||
69 | static int | ||
70 | xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) | ||
71 | { | ||
72 | unw_init_running(xen_panic_hypercall, NULL); | ||
73 | /* we're never actually going to get here... */ | ||
74 | return NOTIFY_DONE; | ||
75 | } | ||
76 | |||
77 | static struct notifier_block xen_panic_block = { | ||
78 | xen_panic_event, NULL, 0 /* try to go last */ | ||
79 | }; | ||
80 | |||
81 | static void xen_pm_power_off(void) | ||
82 | { | ||
83 | local_irq_disable(); | ||
84 | HYPERVISOR_shutdown(SHUTDOWN_poweroff); | ||
85 | } | ||
86 | |||
87 | static void __init | ||
88 | xen_banner(void) | ||
89 | { | ||
90 | printk(KERN_INFO | ||
91 | "Running on Xen! pl = %d start_info_pfn=0x%lx nr_pages=%ld " | ||
92 | "flags=0x%x\n", | ||
93 | xen_info.kernel_rpl, | ||
94 | HYPERVISOR_shared_info->arch.start_info_pfn, | ||
95 | xen_start_info->nr_pages, xen_start_info->flags); | ||
96 | } | ||
97 | |||
98 | static int __init | ||
99 | xen_reserve_memory(struct rsvd_region *region) | ||
100 | { | ||
101 | region->start = (unsigned long)__va( | ||
102 | (HYPERVISOR_shared_info->arch.start_info_pfn << PAGE_SHIFT)); | ||
103 | region->end = region->start + PAGE_SIZE; | ||
104 | return 1; | ||
105 | } | ||
106 | |||
107 | static void __init | ||
108 | xen_arch_setup_early(void) | ||
109 | { | ||
110 | struct shared_info *s; | ||
111 | BUG_ON(!xen_pv_domain()); | ||
112 | |||
113 | s = HYPERVISOR_shared_info; | ||
114 | xen_start_info = __va(s->arch.start_info_pfn << PAGE_SHIFT); | ||
115 | |||
116 | /* Must be done before any hypercall. */ | ||
117 | xencomm_initialize(); | ||
118 | |||
119 | xen_setup_features(); | ||
120 | /* Register a call for panic conditions. */ | ||
121 | atomic_notifier_chain_register(&panic_notifier_list, | ||
122 | &xen_panic_block); | ||
123 | pm_power_off = xen_pm_power_off; | ||
124 | |||
125 | xen_ia64_enable_opt_feature(); | ||
126 | } | ||
127 | |||
128 | static void __init | ||
129 | xen_arch_setup_console(char **cmdline_p) | ||
130 | { | ||
131 | add_preferred_console("xenboot", 0, NULL); | ||
132 | add_preferred_console("tty", 0, NULL); | ||
133 | /* use hvc_xen */ | ||
134 | add_preferred_console("hvc", 0, NULL); | ||
135 | |||
136 | #if !defined(CONFIG_VT) || !defined(CONFIG_DUMMY_CONSOLE) | ||
137 | conswitchp = NULL; | ||
138 | #endif | ||
139 | } | ||
140 | |||
141 | static int __init | ||
142 | xen_arch_setup_nomca(void) | ||
143 | { | ||
144 | return 1; | ||
145 | } | ||
146 | |||
147 | static void __init | ||
148 | xen_post_smp_prepare_boot_cpu(void) | ||
149 | { | ||
150 | xen_setup_vcpu_info_placement(); | ||
151 | } | ||
152 | |||
153 | static const struct pv_init_ops xen_init_ops __initdata = { | ||
154 | .banner = xen_banner, | ||
155 | |||
156 | .reserve_memory = xen_reserve_memory, | ||
157 | |||
158 | .arch_setup_early = xen_arch_setup_early, | ||
159 | .arch_setup_console = xen_arch_setup_console, | ||
160 | .arch_setup_nomca = xen_arch_setup_nomca, | ||
161 | |||
162 | .post_smp_prepare_boot_cpu = xen_post_smp_prepare_boot_cpu, | ||
163 | }; | ||
164 | |||
165 | /*************************************************************************** | ||
57 | * pv_ops initialization | 166 | * pv_ops initialization |
58 | */ | 167 | */ |
59 | 168 | ||
@@ -62,4 +171,5 @@ xen_setup_pv_ops(void) | |||
62 | { | 171 | { |
63 | xen_info_init(); | 172 | xen_info_init(); |
64 | pv_info = xen_info; | 173 | pv_info = xen_info; |
174 | pv_init_ops = xen_init_ops; | ||
65 | } | 175 | } |