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 6/9] Add cpu idle pwr mgmt to xen

To: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH 6/9] Add cpu idle pwr mgmt to xen
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Mon, 28 Apr 2008 22:41:04 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 28 Apr 2008 07:41:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4815B5CF.76E4.0078.0@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <094BCE01AFBE9646AF220B0B3F367AAB02FE2C73@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4815B5CF.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcipEr8if3DbkqnuQ2yqUi+VHCdFJwAAO90Q
Thread-topic: [Xen-devel] [PATCH 6/9] Add cpu idle pwr mgmt to xen
On Monday, April 28, 2008 5:33 PM, Jan Beulich wrote:
>>>> "Wei, Gang" <gang.wei@xxxxxxxxx> 25.04.08 07:08 >>>
>> Port acpi bit register support from Linux.
>> 
>> Bit register read/write is required by deep C code.
>> Remove dependendy on acpi_sinfo.
>> 
>> Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
>> 
>> +static void __init
>> +acpi_fadt_parse_reg(struct acpi_table_fadt *fadt)
>> +{
>> +    memcpy(&acpi_gbl_FADT, fadt, sizeof(acpi_gbl_FADT)); +
>> +    memcpy(&acpi_gbl_xpm1a_enable, &(fadt->xpm1a_event_block),
>> +            sizeof(acpi_gbl_xpm1a_enable));
>> +    memcpy(&acpi_gbl_xpm1b_enable, &(fadt->xpm1b_event_block),
>> +            sizeof(acpi_gbl_xpm1b_enable));
>> +
>> +    acpi_gbl_xpm1a_enable.address += 2;
>> +    acpi_gbl_xpm1b_enable.address += 2;
>> +}
> 
> This doesn't look right: For one, PM1b is optional, and hence if you
add
> a non-zero value to a zero address (which is commonly used as the
> presence indicator) consumers all of the sudden could consider the
block
> present. The other thing is that while on today's systems using a
literal
> 2 here may be correct, it isn't according to the ACPI spec - you'd
ought
> to add half the block width instead.

You are absolutely right for both things metioned above. Thanks for the
detailed review.

I would like to change code as below:

+       acpi_gbl_xpm1a_enable.address += acpi_gbl_FADT.pm1_event_length
/ 2.;
+          if ( acpi_gbl_xpm1b_enable.address )
+           acpi_gbl_xpm1b_enable.address +=
acpi_gbl_FADT.pm1_event_length / 2;

> 
> Jan

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

<Prev in Thread] Current Thread [Next in Thread>