ia64/xen-unstable

changeset 18190:b0ee5e8613e9

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@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 29 13:27:29 2008 +0100 (2008-07-29)
parents 5fbcbee355e2
children a538185695ed
files xen/arch/x86/acpi/cpufreq/utility.c xen/arch/x86/acpi/pmstat.c xen/arch/x86/platform_hypercall.c xen/include/acpi/cpufreq/processor_perf.h
line diff
     1.1 --- a/xen/arch/x86/acpi/cpufreq/utility.c	Tue Jul 29 13:24:57 2008 +0100
     1.2 +++ b/xen/arch/x86/acpi/cpufreq/utility.c	Tue Jul 29 13:27:29 2008 +0100
     1.3 @@ -296,12 +296,11 @@ void cpufreq_suspend(void)
     1.4  {
     1.5      int cpu;
     1.6  
     1.7 -    /* to protect the case when Px was controlled by dom0-kernel */
     1.8 -    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
     1.9 +    /* to protect the case when Px was not controlled by xen */
    1.10      for_each_online_cpu(cpu) {
    1.11          struct processor_performance *perf = &processor_pminfo[cpu].perf;
    1.12  
    1.13 -        if (!perf->init)
    1.14 +        if (!(perf->init & XEN_PX_INIT))
    1.15              return;
    1.16      }
    1.17  
    1.18 @@ -316,14 +315,13 @@ int cpufreq_resume(void)
    1.19  {
    1.20      int cpu, ret = 0;
    1.21  
    1.22 -    /* 1. to protect the case when Px was controlled by dom0-kernel */
    1.23 -    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
    1.24 +    /* 1. to protect the case when Px was not controlled by xen */
    1.25      /* 2. set state and resume flag to sync cpu to right state and freq */
    1.26      for_each_online_cpu(cpu) {
    1.27          struct processor_performance *perf = &processor_pminfo[cpu].perf;
    1.28          struct cpufreq_policy *policy = &xen_px_policy[cpu];
    1.29  
    1.30 -        if (!perf->init)
    1.31 +        if (!(perf->init & XEN_PX_INIT))
    1.32              goto err;
    1.33          perf->state = 0;
    1.34          policy->resume = 1;
     2.1 --- a/xen/arch/x86/acpi/pmstat.c	Tue Jul 29 13:24:57 2008 +0100
     2.2 +++ b/xen/arch/x86/acpi/pmstat.c	Tue Jul 29 13:27:29 2008 +0100
     2.3 @@ -52,9 +52,9 @@ int do_get_pm_info(struct xen_sysctl_get
     2.4      struct pm_px *pxpt = &px_statistic_data[op->cpuid];
     2.5      struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid];
     2.6  
     2.7 -    /* to protect the case when Px was controlled by dom0-kernel */
     2.8 -    /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
     2.9 -    if ( !pmpt->perf.init && (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
    2.10 +    /* to protect the case when Px was not controlled by xen */
    2.11 +    if ( (!(pmpt->perf.init & XEN_PX_INIT)) && 
    2.12 +        (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
    2.13          return -EINVAL;
    2.14  
    2.15      if ( !cpu_online(op->cpuid) )
     3.1 --- a/xen/arch/x86/platform_hypercall.c	Tue Jul 29 13:24:57 2008 +0100
     3.2 +++ b/xen/arch/x86/platform_hypercall.c	Tue Jul 29 13:27:29 2008 +0100
     3.3 @@ -415,7 +415,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
     3.4              if ( pxpt->init == ( XEN_PX_PCT | XEN_PX_PSS |
     3.5                                   XEN_PX_PSD | XEN_PX_PPC ) )
     3.6              {
     3.7 -                pxpt->init |= 0x80000000;
     3.8 +                pxpt->init |= XEN_PX_INIT;
     3.9                  cpu_count++;
    3.10              }
    3.11              if ( cpu_count == num_online_cpus() )
     4.1 --- a/xen/include/acpi/cpufreq/processor_perf.h	Tue Jul 29 13:24:57 2008 +0100
     4.2 +++ b/xen/include/acpi/cpufreq/processor_perf.h	Tue Jul 29 13:27:29 2008 +0100
     4.3 @@ -4,6 +4,8 @@
     4.4  #include <public/platform.h>
     4.5  #include <public/sysctl.h>
     4.6  
     4.7 +#define XEN_PX_INIT 0x80000000
     4.8 +
     4.9  int get_cpu_id(u8);
    4.10  int acpi_cpufreq_init(void);
    4.11  int powernow_cpufreq_init(void);