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-devel

[Xen-devel] [PATCH][2/2] Fix RevF detection in powernow.c

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][2/2] Fix RevF detection in powernow.c
From: Mark Langsdorf <mark.langsdorf@xxxxxxx>
Date: Thu, 22 Oct 2009 10:53:35 -0500
Delivery-date: Thu, 22 Oct 2009 08:53:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.10
The PowerNow! driver does not support RevF and earlier parts.
The current code checks for RevF processors in a function that
is not called.  Change the code path so that RevF processors
are detected and the driver fails registration.

As cpufreq_add_cpu() assumes registration is successful, the
patch "In cpufreq, check for a driver before use" needs to
be applied first or else Xen will crash when the driver fails
registration.

Signed-off-by: Mark Langsdorf <mark.langsdorf@xxxxxxx>

diff -r d7d7f978d704 xen/arch/x86/acpi/cpufreq/powernow.c
--- a/xen/arch/x86/acpi/cpufreq/powernow.c      Tue Oct 20 14:36:01 2009 +0100
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c      Wed Oct 21 15:12:00 2009 -0500
@@ -274,58 +274,23 @@
 
 unsigned int powernow_register_driver()
 {
-    unsigned int ret;
-    ret = cpufreq_register_driver(&powernow_cpufreq_driver);
-    return ret;
-}
-
-int powernow_cpufreq_init(void)
-{
     unsigned int i, ret = 0;
-    unsigned int max_dom = 0;
-    cpumask_t *pt;
-    unsigned long *dom_mask;
 
     for_each_online_cpu(i) {
         struct cpuinfo_x86 *c = &cpu_data[i];
-       if (c->x86_vendor != X86_VENDOR_AMD)
+        if (c->x86_vendor != X86_VENDOR_AMD)
             ret = -ENODEV;
-        else 
+        else
         {
             u32 eax, ebx, ecx, edx;
             cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
             if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE)
                 ret = -ENODEV;
-       }
+        }
         if (ret)
             return ret;
-        if (max_dom < processor_pminfo[i]->perf.domain_info.domain)
-            max_dom = processor_pminfo[i]->perf.domain_info.domain;
-    }
-    max_dom++;
-
-    dom_mask = xmalloc_array(unsigned long, BITS_TO_LONGS(max_dom));
-    if (!dom_mask)
-        return -ENOMEM;
-    bitmap_zero(dom_mask, max_dom);
-
-    pt = xmalloc_array(cpumask_t, max_dom);
-    if (!pt)
-        return -ENOMEM;
-    memset(pt, 0, max_dom * sizeof(cpumask_t));
-
-    /* get cpumask of each psd domain */
-    for_each_online_cpu(i) {
-        __set_bit(processor_pminfo[i]->perf.domain_info.domain, dom_mask);
-        cpu_set(i, pt[processor_pminfo[i]->perf.domain_info.domain]);
     }
 
-    for_each_online_cpu(i)
-        processor_pminfo[i]->perf.shared_cpu_map =
-            pt[processor_pminfo[i]->perf.domain_info.domain];
-
-    xfree(pt);
-    xfree(dom_mask);
-   
+    ret = cpufreq_register_driver(&powernow_cpufreq_driver);
     return ret;
 }


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][2/2] Fix RevF detection in powernow.c, Mark Langsdorf <=