enlighten.c (88e957d6e47f1232ad15b21e54a44f1147ea8c1b) enlighten.c (ad5475f9faf5186b7f59de2c6481ee3e211f1ed7)
1/*
2 * Core of Xen paravirt_ops implementation.
3 *
4 * This file contains the xen_paravirt_ops structure itself, and the
5 * implementations for:
6 * - privileged instructions
7 * - interrupt flags
8 * - segment operations

--- 214 unchanged lines hidden (view full) ---

223 /* Check to see if the hypervisor will put the vcpu_info
224 structure where we want it, which allows direct access via
225 a percpu-variable.
226 N.B. This hypercall can _only_ be called once per CPU. Subsequent
227 calls will error out with -EINVAL. This is due to the fact that
228 hypervisor has no unregister variant and this hypercall does not
229 allow to over-write info.mfn and info.offset.
230 */
1/*
2 * Core of Xen paravirt_ops implementation.
3 *
4 * This file contains the xen_paravirt_ops structure itself, and the
5 * implementations for:
6 * - privileged instructions
7 * - interrupt flags
8 * - segment operations

--- 214 unchanged lines hidden (view full) ---

223 /* Check to see if the hypervisor will put the vcpu_info
224 structure where we want it, which allows direct access via
225 a percpu-variable.
226 N.B. This hypercall can _only_ be called once per CPU. Subsequent
227 calls will error out with -EINVAL. This is due to the fact that
228 hypervisor has no unregister variant and this hypercall does not
229 allow to over-write info.mfn and info.offset.
230 */
231 err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info);
231 err = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, xen_vcpu_nr(cpu),
232 &info);
232
233 if (err) {
234 printk(KERN_DEBUG "register_vcpu_info failed: err=%d\n", err);
235 have_vcpu_info_placement = 0;
236 clamp_max_cpus();
237 } else {
238 /* This cpu is using the registered vcpu info, even if
239 later ones fail to. */

--- 7 unchanged lines hidden (view full) ---

247 * we can't back out from using it...
248 */
249void xen_vcpu_restore(void)
250{
251 int cpu;
252
253 for_each_possible_cpu(cpu) {
254 bool other_cpu = (cpu != smp_processor_id());
233
234 if (err) {
235 printk(KERN_DEBUG "register_vcpu_info failed: err=%d\n", err);
236 have_vcpu_info_placement = 0;
237 clamp_max_cpus();
238 } else {
239 /* This cpu is using the registered vcpu info, even if
240 later ones fail to. */

--- 7 unchanged lines hidden (view full) ---

248 * we can't back out from using it...
249 */
250void xen_vcpu_restore(void)
251{
252 int cpu;
253
254 for_each_possible_cpu(cpu) {
255 bool other_cpu = (cpu != smp_processor_id());
255 bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
256 bool is_up = HYPERVISOR_vcpu_op(VCPUOP_is_up, xen_vcpu_nr(cpu),
257 NULL);
256
257 if (other_cpu && is_up &&
258
259 if (other_cpu && is_up &&
258 HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
260 HYPERVISOR_vcpu_op(VCPUOP_down, xen_vcpu_nr(cpu), NULL))
259 BUG();
260
261 xen_setup_runstate_info(cpu);
262
263 if (have_vcpu_info_placement)
264 xen_vcpu_setup(cpu);
265
266 if (other_cpu && is_up &&
261 BUG();
262
263 xen_setup_runstate_info(cpu);
264
265 if (have_vcpu_info_placement)
266 xen_vcpu_setup(cpu);
267
268 if (other_cpu && is_up &&
267 HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
269 HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL))
268 BUG();
269 }
270}
271
272static void __init xen_banner(void)
273{
274 unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL);
275 struct xen_extraversion extra;

--- 1675 unchanged lines hidden ---
270 BUG();
271 }
272}
273
274static void __init xen_banner(void)
275{
276 unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL);
277 struct xen_extraversion extra;

--- 1675 unchanged lines hidden ---