WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-3.4-testing] Add cpufreq sanity check

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.4-testing] Add cpufreq sanity check
From: "Xen patchbot-3.4-testing" <patchbot-3.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 09 Mar 2010 10:25:33 -0800
Delivery-date: Tue, 09 Mar 2010 10:27:12 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1268158519 0
# Node ID 9923e27010643fb4db72546171d9fccbc6156e22
# Parent  d904c3b5e72a7d9c6a0931f9f649723458363d50
Add cpufreq sanity check

This fixes bug 1585
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=3D1585

root cause: with incorrect BIOS info, cpufreq driver may not start. in
this case, if user use xenpm to manipulate cpufreq driver, NULL
pointer will cause xen panic. this patch add the sanity check and
warning info to fix this issue.

Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>
xen-unstable changeset:   21014:efa827c5bf73
xen-unstable date:        Tue Mar 09 09:59:59 2010 +0000
---
 xen/drivers/cpufreq/cpufreq.c          |   10 ++++++++++
 xen/drivers/cpufreq/cpufreq_ondemand.c |    6 ++++++
 2 files changed, 16 insertions(+)

diff -r d904c3b5e72a -r 9923e2701064 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c     Tue Mar 09 18:14:53 2010 +0000
+++ b/xen/drivers/cpufreq/cpufreq.c     Tue Mar 09 18:15:19 2010 +0000
@@ -177,6 +177,15 @@ int cpufreq_add_cpu(unsigned int cpu)
             processor_pminfo[firstcpu]->perf.domain_info.coord_type) ||
             (perf->domain_info.num_processors !=
             processor_pminfo[firstcpu]->perf.domain_info.num_processors)) {
+
+            printk(KERN_WARNING "cpufreq fail to add CPU%d:"
+                   "incorrect _PSD(%"PRIu64":%"PRIu64"), "
+                   "expect(%"PRIu64"/%"PRIu64")\n",
+                   cpu, perf->domain_info.coord_type,
+                   perf->domain_info.num_processors,
+                   processor_pminfo[firstcpu]->perf.domain_info.coord_type,
+                   processor_pminfo[firstcpu]->perf.domain_info.num_processors
+                );
             return -EINVAL;
         }
     }
@@ -193,6 +202,7 @@ int cpufreq_add_cpu(unsigned int cpu)
         ret = cpufreq_driver->init(policy);
         if (ret) {
             xfree(policy);
+            cpufreq_cpu_policy[cpu] = NULL;
             return ret;
         }
         printk(KERN_EMERG"CPU %u initialization completed\n", cpu);
diff -r d904c3b5e72a -r 9923e2701064 xen/drivers/cpufreq/cpufreq_ondemand.c
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c    Tue Mar 09 18:14:53 2010 +0000
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c    Tue Mar 09 18:15:19 2010 +0000
@@ -276,6 +276,12 @@ int cpufreq_governor_dbs(struct cpufreq_
         break;
 
     case CPUFREQ_GOV_LIMITS:
+        if ( this_dbs_info->cur_policy == NULL )
+        {
+            printk(KERN_WARNING "CPU%d ondemand governor not started yet,"
+                    "unable to GOV_LIMIT\n", cpu);
+            return -EINVAL;
+        }
         if (policy->max < this_dbs_info->cur_policy->cur)
             __cpufreq_driver_target(this_dbs_info->cur_policy,
                 policy->max, CPUFREQ_RELATION_H);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.4-testing] Add cpufreq sanity check, Xen patchbot-3.4-testing <=