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

[Xen-changelog] [xen-unstable] Change Px control protection corresponding to changeset 18125



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217334449 -3600
# Node ID b0ee5e8613e9b9ee2d331cfa045d68353ceafb45
# Parent  5fbcbee355e23986326a539a936b68cf3b17f0db
Change Px control protection corresponding to changeset 18125

xen changeset 18125(ab1d7db3facb) changed some px init logic, which
has some effect to Px statistic and S3 suspend/resume logic.
This patch change Px control protection corresponding to changeset
18125.

Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---
 xen/arch/x86/acpi/cpufreq/utility.c       |   10 ++++------
 xen/arch/x86/acpi/pmstat.c                |    6 +++---
 xen/arch/x86/platform_hypercall.c         |    2 +-
 xen/include/acpi/cpufreq/processor_perf.h |    2 ++
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -r 5fbcbee355e2 -r b0ee5e8613e9 xen/arch/x86/acpi/cpufreq/utility.c
--- a/xen/arch/x86/acpi/cpufreq/utility.c       Tue Jul 29 13:24:57 2008 +0100
+++ b/xen/arch/x86/acpi/cpufreq/utility.c       Tue Jul 29 13:27:29 2008 +0100
@@ -296,12 +296,11 @@ void cpufreq_suspend(void)
 {
     int cpu;
 
-    /* to protect the case when Px was controlled by dom0-kernel */
-    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
+    /* to protect the case when Px was not controlled by xen */
     for_each_online_cpu(cpu) {
         struct processor_performance *perf = &processor_pminfo[cpu].perf;
 
-        if (!perf->init)
+        if (!(perf->init & XEN_PX_INIT))
             return;
     }
 
@@ -316,14 +315,13 @@ int cpufreq_resume(void)
 {
     int cpu, ret = 0;
 
-    /* 1. to protect the case when Px was controlled by dom0-kernel */
-    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
+    /* 1. to protect the case when Px was not controlled by xen */
     /* 2. set state and resume flag to sync cpu to right state and freq */
     for_each_online_cpu(cpu) {
         struct processor_performance *perf = &processor_pminfo[cpu].perf;
         struct cpufreq_policy *policy = &xen_px_policy[cpu];
 
-        if (!perf->init)
+        if (!(perf->init & XEN_PX_INIT))
             goto err;
         perf->state = 0;
         policy->resume = 1;
diff -r 5fbcbee355e2 -r b0ee5e8613e9 xen/arch/x86/acpi/pmstat.c
--- a/xen/arch/x86/acpi/pmstat.c        Tue Jul 29 13:24:57 2008 +0100
+++ b/xen/arch/x86/acpi/pmstat.c        Tue Jul 29 13:27:29 2008 +0100
@@ -52,9 +52,9 @@ int do_get_pm_info(struct xen_sysctl_get
     struct pm_px *pxpt = &px_statistic_data[op->cpuid];
     struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid];
 
-    /* to protect the case when Px was controlled by dom0-kernel */
-    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
-    if ( !pmpt->perf.init && (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
+    /* to protect the case when Px was not controlled by xen */
+    if ( (!(pmpt->perf.init & XEN_PX_INIT)) && 
+        (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
         return -EINVAL;
 
     if ( !cpu_online(op->cpuid) )
diff -r 5fbcbee355e2 -r b0ee5e8613e9 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Tue Jul 29 13:24:57 2008 +0100
+++ b/xen/arch/x86/platform_hypercall.c Tue Jul 29 13:27:29 2008 +0100
@@ -415,7 +415,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
             if ( pxpt->init == ( XEN_PX_PCT | XEN_PX_PSS |
                                  XEN_PX_PSD | XEN_PX_PPC ) )
             {
-                pxpt->init |= 0x80000000;
+                pxpt->init |= XEN_PX_INIT;
                 cpu_count++;
             }
             if ( cpu_count == num_online_cpus() )
diff -r 5fbcbee355e2 -r b0ee5e8613e9 xen/include/acpi/cpufreq/processor_perf.h
--- a/xen/include/acpi/cpufreq/processor_perf.h Tue Jul 29 13:24:57 2008 +0100
+++ b/xen/include/acpi/cpufreq/processor_perf.h Tue Jul 29 13:27:29 2008 +0100
@@ -3,6 +3,8 @@
 
 #include <public/platform.h>
 #include <public/sysctl.h>
+
+#define XEN_PX_INIT 0x80000000
 
 int get_cpu_id(u8);
 int acpi_cpufreq_init(void);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.