xcp-1.6-updates/xen-4.1.hg

changeset 23313:9fe2a77b740d

pm: don't truncate processors' ACPI IDs to 8 bits

This is just another adjustment to allow systems with very many CPUs
(or unusual ACPI IDs) to be properly power-managed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 23781:0849b0e59e24
xen-unstable date: Mon Aug 22 10:10:39 2011 +0100
author Jan Beulich <jbeulich@novell.com>
date Mon Jul 09 10:22:24 2012 +0100 (2012-07-09)
parents b394b1f87ebc
children 10d5cc3094d6
files xen/arch/ia64/linux-xen/acpi.c xen/arch/x86/acpi/cpu_idle.c xen/include/acpi/cpufreq/processor_perf.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/acpi.c	Mon Jul 09 10:21:42 2012 +0100
     1.2 +++ b/xen/arch/ia64/linux-xen/acpi.c	Mon Jul 09 10:22:24 2012 +0100
     1.3 @@ -223,11 +223,14 @@ static u16 ia64_acpiid_to_sapicid[ MAX_L
     1.4  		{[0 ... MAX_LOCAL_SAPIC - 1] = 0xffff };
     1.5  
     1.6  /* acpi id to cpu id */
     1.7 -int get_cpu_id(u8 acpi_id)
     1.8 +int get_cpu_id(u32 acpi_id)
     1.9  {
    1.10  	int i;
    1.11  	u16 apic_id;
    1.12  
    1.13 +	if ( acpi_id >= MAX_LOCAL_SAPIC )
    1.14 +		return -EINVAL;
    1.15 +
    1.16  	apic_id = ia64_acpiid_to_sapicid[acpi_id];
    1.17  	if ( apic_id == 0xffff )
    1.18  		return -EINVAL;
     2.1 --- a/xen/arch/x86/acpi/cpu_idle.c	Mon Jul 09 10:21:42 2012 +0100
     2.2 +++ b/xen/arch/x86/acpi/cpu_idle.c	Mon Jul 09 10:22:24 2012 +0100
     2.3 @@ -902,11 +902,14 @@ static void set_cx(
     2.4          acpi_power->safe_state = cx;
     2.5  }
     2.6  
     2.7 -int get_cpu_id(u8 acpi_id)
     2.8 +int get_cpu_id(u32 acpi_id)
     2.9  {
    2.10      int i;
    2.11      u32 apic_id;
    2.12  
    2.13 +    if ( acpi_id >= MAX_MADT_ENTRIES )
    2.14 +        return -1;
    2.15 +
    2.16      apic_id = x86_acpiid_to_apicid[acpi_id];
    2.17      if ( apic_id == BAD_APICID )
    2.18          return -1;
    2.19 @@ -983,7 +986,7 @@ long set_cx_pminfo(uint32_t cpu, struct 
    2.20      print_cx_pminfo(cpu, power);
    2.21  
    2.22      /* map from acpi_id to cpu_id */
    2.23 -    cpu_id = get_cpu_id((u8)cpu);
    2.24 +    cpu_id = get_cpu_id(cpu);
    2.25      if ( cpu_id == -1 )
    2.26      {
    2.27          printk(XENLOG_ERR "no cpu_id for acpi_id %d\n", cpu);
     3.1 --- a/xen/include/acpi/cpufreq/processor_perf.h	Mon Jul 09 10:21:42 2012 +0100
     3.2 +++ b/xen/include/acpi/cpufreq/processor_perf.h	Mon Jul 09 10:22:24 2012 +0100
     3.3 @@ -6,7 +6,7 @@
     3.4  
     3.5  #define XEN_PX_INIT 0x80000000
     3.6  
     3.7 -int get_cpu_id(u8);
     3.8 +int get_cpu_id(u32);
     3.9  int powernow_cpufreq_init(void);
    3.10  unsigned int powernow_register_driver(void);
    3.11  unsigned int get_measured_perf(unsigned int cpu, unsigned int flag);