Jan Beulich
2008-Sep-19 13:21 UTC
[Xen-devel] [PATCH] linux: fix processor handling in presence of external control
- 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@novell.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Maybe Matching Threads
- [RFC] pvops domain0 Cx/Px info parser patch
- [RFC PATCH] Exporting ACPI Pxx/Cxx states to other kernel subsystems (v1).
- 4.14: WARNING: CPU: 4 PID: 2895 at block/blk-mq.c:1144 with virtio-blk (also 4.12 stable)
- cpu frequency scaling in xen 3.3.1
- 4.14: WARNING: CPU: 4 PID: 2895 at block/blk-mq.c:1144 with virtio-blk (also 4.12 stable)