[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.2] x86/cpuidle: publish new states only after fully initializing them



commit b28c7b29999bf6bfcbe8ff977a15dbacf0f1ad84
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Jan 10 11:41:53 2014 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Jan 10 11:41:53 2014 +0100

    x86/cpuidle: publish new states only after fully initializing them
    
    Since state information coming from Dom0 can arrive at any time, on
    any CPU, we ought to make sure that a new state is fully initialized
    before the target CPU might be using it.
    
    Once touching that code, also do minor cleanup: A missing (but benign)
    "break" and some white space adjustments.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Liu Jinsong <jinsong.liu@xxxxxxxxx>
    master commit: 4ca6f9f0377a30755a299cc60a6d44ab6c3b34d0
    master date: 2013-12-11 10:30:02 +0100
---
 xen/arch/x86/acpi/cpu_idle.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index c5c34df..989d034 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -925,7 +925,7 @@ static void set_cx(
                    acpi_power->cpu, xen_cx->type);
             return;
         }
-        cx = &acpi_power->states[acpi_power->count++];
+        cx = &acpi_power->states[acpi_power->count];
         cx->type = xen_cx->type;
         break;
     }
@@ -957,6 +957,9 @@ static void set_cx(
     
     cx->latency_ticks = ns_to_tick(cx->latency * 1000UL);
     cx->target_residency = cx->latency * latency_factor;
+
+    smp_wmb();
+    acpi_power->count++;
     if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
         acpi_power->safe_state = cx;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.