XENPF_set_processor_pminfo XEN_PM_CX overflows states array
authorEric Chanudet <eric.chanudet@eu.citrix.com>
Thu, 8 Mar 2012 16:04:32 +0000 (17:04 +0100)
committerEric Chanudet <eric.chanudet@eu.citrix.com>
Thu, 8 Mar 2012 16:04:32 +0000 (17:04 +0100)
commit2ab5a5dd986b46bea1094cc1e923d4dab88056d9
tree8e6c28be87f16e4775967caa845959b5a750686f
parentcae10a689a5ee104a24dc01131e1d71d4060cc70
XENPF_set_processor_pminfo XEN_PM_CX overflows states array

Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states
array in "struct acpi_processor_power" to exceed its limit.

The array used to be reset (by function cpuidle_init_cpu()) for each
hypercall. The patch puts it back that way and adds an assertion to
make it clear in case that happens again.

Signed-off-by: Eric Chanudet <eric.chanudet@eu.citrix.com>
- convert assertion to printk() & bail
- eliminate struct acpi_processor_cx's valid member (not read anymore)
- further adjustments to one-time-only vs each-time operations in
  cpuidle_init_cpu()
- don't use ACPI_STATE_Cn as array index anymore

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/acpi/cpu_idle.c
xen/include/xen/cpuidle.h