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: fix processor handling in presence of externa

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux: fix processor handling in presence of external control
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Fri, 19 Sep 2008 14:21:12 +0100
Delivery-date: Fri, 19 Sep 2008 06:20:58 -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
- avoid leaking stuff in acpi_processor_remove()
- remove a pointless change to native code in acpi_processor_hotplug()
  (struct acpi_processor's id field is unsigned)
- don't set up processor_extcntl_ops when nothing controlled by Xen
  (thus processor_cntl_external() will always return false, allowing
  ACPI code to retain native behavior)

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

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

Index: head-2008-09-15/arch/i386/kernel/acpi/processor_extcntl_xen.c
===================================================================
--- head-2008-09-15.orig/arch/i386/kernel/acpi/processor_extcntl_xen.c  
2008-09-19 12:54:32.000000000 +0200
+++ head-2008-09-15/arch/i386/kernel/acpi/processor_extcntl_xen.c       
2008-09-19 12:55:29.000000000 +0200
@@ -215,6 +215,8 @@ void arch_acpi_processor_init_extcntl(co
 {
        unsigned int pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
 
+       if (!pmbits)
+               return;
        if (pmbits & XEN_PROCESSOR_PM_CX)
                xen_extcntl_ops.pm_ops[PM_TYPE_IDLE] = xen_cx_notifier;
        if (pmbits & XEN_PROCESSOR_PM_PX)
Index: head-2008-09-15/drivers/acpi/processor_core.c
===================================================================
--- head-2008-09-15.orig/drivers/acpi/processor_core.c  2008-09-19 
12:55:04.000000000 +0200
+++ head-2008-09-15/drivers/acpi/processor_core.c       2008-09-19 
12:13:42.000000000 +0200
@@ -661,7 +661,7 @@ static int acpi_processor_remove(struct 
 
        pr = (struct acpi_processor *)acpi_driver_data(device);
 
-       if (pr->id >= NR_CPUS) {
+       if (!processor_cntl_external() && pr->id >= NR_CPUS) {
                kfree(pr);
                return 0;
        }
@@ -831,12 +831,7 @@ static void __ref acpi_processor_hotplug
                        return;
                }
 
-#ifdef CONFIG_XEN
-               if ((pr->id >= 0) && (pr->id < NR_CPUS)
-                   && (cpu_present(pr->id)))
-#else
                if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
-#endif /* CONFIG_XEN */
                        kobject_uevent(&device->kobj, KOBJ_OFFLINE);
 
                if (processor_cntl_external())




_______________________________________________
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: fix processor handling in presence of external control, Jan Beulich <=