ia64/xen-unstable

changeset 10921:b13ea287f9c0

[IA64] avoid spurious XENBUS error

Create just as many LSAPIC entries in MADT as the number of cpus.
This avoids spurious XENBUS errors when kernel try to read xenstore entries
for cpus unknown by xend/xenstore.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Aug 02 15:04:03 2006 -0600 (2006-08-02)
parents b76e86966e7e
children 561df7d9cecc
files xen/arch/ia64/xen/dom_fw.c
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Wed Aug 02 13:39:47 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Wed Aug 02 15:04:03 2006 -0600
     1.3 @@ -342,6 +342,7 @@ dom_fw_fake_acpi(struct domain *d, struc
     1.4  	struct acpi_table_lsapic *lsapic = tables->lsapic;
     1.5  	int i;
     1.6  	int aml_len;
     1.7 +	int nbr_cpus;
     1.8  
     1.9  	memset(tables, 0, sizeof(struct fake_acpi_tables));
    1.10  
    1.11 @@ -452,8 +453,6 @@ dom_fw_fake_acpi(struct domain *d, struc
    1.12  	/* setup MADT */
    1.13  	strncpy(madt->header.signature, APIC_SIG, 4);
    1.14  	madt->header.revision = 2;
    1.15 -	madt->header.length = sizeof(struct acpi_table_madt) +
    1.16 -		MAX_VIRT_CPUS * sizeof(struct acpi_table_lsapic);
    1.17  	strcpy(madt->header.oem_id, "XEN");
    1.18  	strcpy(madt->header.oem_table_id, "Xen/ia64");
    1.19  	strcpy(madt->header.asl_compiler_id, "XEN");
    1.20 @@ -461,15 +460,20 @@ dom_fw_fake_acpi(struct domain *d, struc
    1.21  		xen_minor_version();
    1.22  
    1.23  	/* An LSAPIC entry describes a CPU.  */
    1.24 +	nbr_cpus = 0;
    1.25  	for (i = 0; i < MAX_VIRT_CPUS; i++) {
    1.26  		lsapic[i].header.type = ACPI_MADT_LSAPIC;
    1.27  		lsapic[i].header.length = sizeof(struct acpi_table_lsapic);
    1.28  		lsapic[i].acpi_id = i;
    1.29  		lsapic[i].id = i;
    1.30  		lsapic[i].eid = 0;
    1.31 -		lsapic[i].flags.enabled = (d->vcpu[i] != NULL);
    1.32 +		if (d->vcpu[i] != NULL) {
    1.33 +			lsapic[i].flags.enabled = 1;
    1.34 +			nbr_cpus++;
    1.35 +		}
    1.36  	}
    1.37 -
    1.38 +	madt->header.length = sizeof(struct acpi_table_madt) +
    1.39 +	                      nbr_cpus * sizeof(struct acpi_table_lsapic);
    1.40  	madt->header.checksum = generate_acpi_checksum(madt,
    1.41  	                                               madt->header.length);
    1.42  	return;