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

Re: [Xen-devel] [PATCH] pm: don't truncate processors' ACPI IDs to 8 bit

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] pm: don't truncate processors' ACPI IDs to 8 bits
From: Steven <wangwangkang@xxxxxxxxx>
Date: Wed, 24 Aug 2011 16:00:43 -0400
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 24 Aug 2011 13:04:16 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ybV8ByA8Oewnetho+BP09ydySYgAd1T9CdI+fMZ6Iss=; b=Mvi1HOy8a7mzJJlkUPqGfgfwWIznbjAmJfVu1vEOhPDPOJ6S1oI9Vi+JIanwmMuk60 8jNvYqZCoIta+XMlMVt6dBOAa5T6Iho++FHbzkFuU3VUuOmIH2FIK+Dwe6hUtjYBo1G9 iyrdW3nl5tdwKkzMsmDzObZwxf4sBNvXIokkY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E4E97B10200007800052070@xxxxxxxxxxxxxxxxxxxx>
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>
References: <4E4E97B10200007800052070@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Why do you use "u32"? Is it because u32 can support more CPU id than u8?


On Fri, Aug 19, 2011 at 11:04 AM, Jan Beulich <JBeulich@xxxxxxxxxx> wrote:
> 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@xxxxxxxxxx>
>
> --- a/xen/arch/ia64/linux-xen/acpi.c
> +++ b/xen/arch/ia64/linux-xen/acpi.c
> @@ -221,11 +221,14 @@ static u16 ia64_acpiid_to_sapicid[ MAX_L
>                {[0 ... MAX_LOCAL_SAPIC - 1] = 0xffff };
>
>  /* acpi id to cpu id */
> -int get_cpu_id(u8 acpi_id)
> +int get_cpu_id(u32 acpi_id)
>  {
>        int i;
>        u16 apic_id;
>
> +       if ( acpi_id >= MAX_LOCAL_SAPIC )
> +               return -EINVAL;
> +
>        apic_id = ia64_acpiid_to_sapicid[acpi_id];
>        if ( apic_id == 0xffff )
>                return -EINVAL;
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -895,11 +895,14 @@ static void set_cx(
>         acpi_power->safe_state = cx;
>  }
>
> -int get_cpu_id(u8 acpi_id)
> +int get_cpu_id(u32 acpi_id)
>  {
>     int i;
>     u32 apic_id;
>
> +    if ( acpi_id >= MAX_MADT_ENTRIES )
> +        return -1;
> +
>     apic_id = x86_acpiid_to_apicid[acpi_id];
>     if ( apic_id == BAD_APICID )
>         return -1;
> @@ -976,7 +979,7 @@ long set_cx_pminfo(uint32_t cpu, struct
>     print_cx_pminfo(cpu, power);
>
>     /* map from acpi_id to cpu_id */
> -    cpu_id = get_cpu_id((u8)cpu);
> +    cpu_id = get_cpu_id(cpu);
>     if ( cpu_id == -1 )
>     {
>         printk(XENLOG_ERR "no cpu_id for acpi_id %d\n", cpu);
> --- a/xen/include/acpi/cpufreq/processor_perf.h
> +++ b/xen/include/acpi/cpufreq/processor_perf.h
> @@ -6,7 +6,7 @@
>
>  #define XEN_PX_INIT 0x80000000
>
> -int get_cpu_id(u8);
> +int get_cpu_id(u32);
>  int powernow_cpufreq_init(void);
>  unsigned int powernow_register_driver(void);
>  unsigned int get_measured_perf(unsigned int cpu, unsigned int flag);
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>

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