From: Keir Fraser Date: Tue, 29 Jul 2008 12:27:29 +0000 (+0100) Subject: Change Px control protection corresponding to changeset 18125 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14165^2~91 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b232ed1a39890be01e0f924f8166b6de572baacf;p=xen.git 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 --- diff --git a/xen/arch/x86/acpi/cpufreq/utility.c b/xen/arch/x86/acpi/cpufreq/utility.c index e34586e3b5..787e91ceef 100644 --- a/xen/arch/x86/acpi/cpufreq/utility.c +++ b/xen/arch/x86/acpi/cpufreq/utility.c @@ -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 --git a/xen/arch/x86/acpi/pmstat.c b/xen/arch/x86/acpi/pmstat.c index cf14fc9d64..ec408a2333 100644 --- a/xen/arch/x86/acpi/pmstat.c +++ b/xen/arch/x86/acpi/pmstat.c @@ -52,9 +52,9 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) 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 --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c index 5a882c7057..b93dc71a23 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -415,7 +415,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op) 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 --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/cpufreq/processor_perf.h index 944aaf63b0..f5251a553c 100644 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ b/xen/include/acpi/cpufreq/processor_perf.h @@ -4,6 +4,8 @@ #include #include +#define XEN_PX_INIT 0x80000000 + int get_cpu_id(u8); int acpi_cpufreq_init(void); int powernow_cpufreq_init(void);