xen: re-register runstate area earlier on resume.
authorIan Campbell <Ian.Campbell@citrix.com>
Sat, 21 Nov 2009 00:35:55 +0000 (08:35 +0800)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Thu, 3 Dec 2009 19:14:50 +0000 (11:14 -0800)
This is necessary to ensure the runstate area is available to
xen_sched_clock before any calls to printk which will require it in
order to provide a timestamp.

I chose to pull the xen_setup_runstate_info out of xen_time_init into
the caller in order to maintain parity with calling
xen_setup_runstate_info separately from calling xen_time_resume.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
arch/x86/xen/enlighten.c
arch/x86/xen/time.c
arch/x86/xen/xen-ops.h

index dfbf70e65860dc768c255e07ac5d2c2b63e3a159..cb61f77e4496ce9f6e3fac1370f608129be45d66 100644 (file)
@@ -148,6 +148,8 @@ void xen_vcpu_restore(void)
                            HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
                                BUG();
 
+                       xen_setup_runstate_info(cpu);
+
                        xen_vcpu_setup(cpu);
 
                        if (other_cpu &&
index 0a5aa44299a51fac214833fe00c68d947ee92367..6bbff94328d221cc6d7d11fe3170fd97a661eb87 100644 (file)
@@ -100,7 +100,7 @@ bool xen_vcpu_stolen(int vcpu)
        return per_cpu(runstate, vcpu).state == RUNSTATE_runnable;
 }
 
-static void setup_runstate_info(int cpu)
+void xen_setup_runstate_info(int cpu)
 {
        struct vcpu_register_runstate_memory_area area;
 
@@ -442,8 +442,6 @@ void xen_setup_timer(int cpu)
 
        evt->cpumask = cpumask_of(cpu);
        evt->irq = irq;
-
-       setup_runstate_info(cpu);
 }
 
 void xen_teardown_timer(int cpu)
@@ -494,6 +492,7 @@ __init void xen_time_init(void)
 
        setup_force_cpu_cap(X86_FEATURE_TSC);
 
+       xen_setup_runstate_info(cpu);
        xen_setup_timer(cpu);
        xen_setup_cpu_clockevents();
 }
index 355fa6b99c9c402e80d8443d2b94647436062c7a..32529326683d152818c68c0c7ad95e309625f288 100644 (file)
@@ -41,6 +41,7 @@ void __init xen_build_dynamic_phys_to_machine(void);
 
 void xen_init_irq_ops(void);
 void xen_setup_timer(int cpu);
+void xen_setup_runstate_info(int cpu);
 void xen_teardown_timer(int cpu);
 cycle_t xen_clocksource_read(void);
 void xen_setup_cpu_clockevents(void);