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] linux: make Xen cpufreq handling also work without _

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: make Xen cpufreq handling also work without _PSD objects
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Mon, 08 Sep 2008 13:58:39 +0100
Delivery-date: Mon, 08 Sep 2008 05:58:43 -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
_PSD objects are optional according to the ACPI spec.

Also eliminate a pointless static variable.

As usual, written and tested on 2.6.27-rc5 and made apply to the 2.6.18
tree without further testing.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: head-2008-09-01/arch/i386/kernel/acpi/processor_extcntl_xen.c
===================================================================
--- head-2008-09-01.orig/arch/i386/kernel/acpi/processor_extcntl_xen.c  
2008-08-07 12:44:36.000000000 +0200
+++ head-2008-09-01/arch/i386/kernel/acpi/processor_extcntl_xen.c       
2008-09-08 11:38:34.000000000 +0200
@@ -32,8 +32,6 @@
 #include <acpi/processor.h>
 #include <asm/hypercall.h>
 
-static int xen_processor_pmbits;
-
 static int xen_cx_notifier(struct acpi_processor *pr, int action)
 {
        int ret, count = 0, i;
@@ -215,13 +213,13 @@ static struct processor_extcntl_ops xen_
 
 void arch_acpi_processor_init_extcntl(const struct processor_extcntl_ops **ops)
 {
-       xen_processor_pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
+       unsigned int pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
 
-       if (xen_processor_pmbits & XEN_PROCESSOR_PM_CX)
+       if (pmbits & XEN_PROCESSOR_PM_CX)
                xen_extcntl_ops.pm_ops[PM_TYPE_IDLE] = xen_cx_notifier;
-       if (xen_processor_pmbits & XEN_PROCESSOR_PM_PX)
+       if (pmbits & XEN_PROCESSOR_PM_PX)
                xen_extcntl_ops.pm_ops[PM_TYPE_PERF] = xen_px_notifier;
-       if (xen_processor_pmbits & XEN_PROCESSOR_PM_TX)
+       if (pmbits & XEN_PROCESSOR_PM_TX)
                xen_extcntl_ops.pm_ops[PM_TYPE_THR] = xen_tx_notifier;
 
        *ops = &xen_extcntl_ops;
Index: head-2008-09-01/drivers/acpi/processor_extcntl.c
===================================================================
--- head-2008-09-01.orig/drivers/acpi/processor_extcntl.c       2008-09-01 
13:03:39.000000000 +0200
+++ head-2008-09-01/drivers/acpi/processor_extcntl.c    2008-09-08 
11:39:11.000000000 +0200
@@ -195,13 +195,22 @@ static int processor_extcntl_get_perform
         * processor objects to external logic. In this case, it's preferred
         * to use ACPI ID instead.
         */
-       pr->performance->domain_info.num_processors = 0;
+       pdomain = &pr->performance->domain_info;
+       pdomain->num_processors = 0;
        ret = acpi_processor_get_psd(pr);
-       if (ret < 0)
-               goto err_out;
+       if (ret < 0) {
+               /*
+                * _PSD is optional - assume no coordination if absent (or
+                * broken), matching native kernels' behavior.
+                */
+               pdomain->num_entries = ACPI_PSD_REV0_ENTRIES;
+               pdomain->revision = ACPI_PSD_REV0_REVISION;
+               pdomain->domain = pr->acpi_id;
+               pdomain->coord_type = DOMAIN_COORD_TYPE_SW_ALL;
+               pdomain->num_processors = 1;
+       }
 
        /* Some sanity check */
-       pdomain = &pr->performance->domain_info;
        if ((pdomain->revision != ACPI_PSD_REV0_REVISION) ||
            (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) ||
            ((pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL) &&




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux: make Xen cpufreq handling also work without _PSD objects, Jan Beulich <=