ia64/xen-unstable

changeset 18285:1dd1b92721fc

[IA64] Cleanup ACPI checksum warnings

On bootup, I get a couple of these:

(XEN) ACPI Warning (tbutils-0219): Incorrect checksum in table [APIC] - CE, should be 04 [20070126]
(XEN) ACPI Warning (tbutils-0219): Incorrect checksum in table [APIC] - CE, should be 04 [20070126]

I don't remember seeing them before, but they're pretty easy to fix.
The problem is we update the lsapics, causing the checksum to be wrong,
then we look for platform interrupt sources, which spits out a warning,
and finally we look for the MADT again to fix the checksum, which also
prints a warning. If we grab a pointer to the MADT before these, we can
update the checksum after each step and avoid the warnings.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Aug 08 11:38:20 2008 +0900 (2008-08-08)
parents 853476b12f56
children 3f9d904d92c4
files xen/arch/ia64/xen/dom_fw_dom0.c
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw_dom0.c	Fri Aug 08 11:38:17 2008 +0900
     1.2 +++ b/xen/arch/ia64/xen/dom_fw_dom0.c	Fri Aug 08 11:38:20 2008 +0900
     1.3 @@ -101,6 +101,9 @@ acpi_update_madt_checksum(struct acpi_ta
     1.4  {
     1.5  	struct acpi_table_madt *acpi_madt;
     1.6  
     1.7 +	if (!table)
     1.8 +		return -EINVAL;
     1.9 +
    1.10  	acpi_madt = (struct acpi_table_madt *)table;
    1.11  	acpi_madt->header.checksum = 0;
    1.12  	acpi_madt->header.checksum = -acpi_tb_checksum((u8*)acpi_madt,
    1.13 @@ -170,8 +173,12 @@ static void __init acpi_table_disable(ch
    1.14  /* base is physical address of acpi table */
    1.15  static void __init touch_acpi_table(void)
    1.16  {
    1.17 +	struct acpi_table_header *madt = NULL;
    1.18 +
    1.19  	lsapic_nbr = 0;
    1.20  
    1.21 +	acpi_get_table(ACPI_SIG_MADT, 0, &madt);
    1.22 +
    1.23  	/*
    1.24  	 * Modify dom0 MADT:
    1.25  	 *  - Disable CPUs that would exceed max vCPUs for the domain
    1.26 @@ -179,16 +186,22 @@ static void __init touch_acpi_table(void
    1.27  	 *  - Hide CPEI interrupt source
    1.28  	 *
    1.29  	 * ACPI tables must be backed-up before modification!
    1.30 +	 *
    1.31 +	 * We update the checksum each time we modify to keep the
    1.32 +	 * ACPI CA from warning about invalid checksums.
    1.33  	 */
    1.34  	acpi_table_parse(ACPI_SIG_MADT, acpi_backup_table);
    1.35  
    1.36  	if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_update_lsapic, 0) < 0)
    1.37  		printk("Error parsing MADT - no LAPIC entries\n");
    1.38 +
    1.39 +	acpi_update_madt_checksum(madt);
    1.40 +
    1.41  	if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC,
    1.42  				  acpi_patch_plat_int_src, 0) < 0)
    1.43  		printk("Error parsing MADT - no PLAT_INT_SRC entries\n");
    1.44  
    1.45 -	acpi_table_parse(ACPI_SIG_MADT, acpi_update_madt_checksum);
    1.46 +	acpi_update_madt_checksum(madt);
    1.47  
    1.48  	/*
    1.49  	 * SRAT & SLIT tables aren't useful for Dom0 until