direct-io.hg

changeset 9297:60578e2ace8e

[IA64] LID virtualization

Virtualize lid for domU.
LSAPIC table cleaned for SMP-g.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Mar 15 08:28:23 2006 -0700 (2006-03-15)
parents dc99944b9bd0
children ab05373d6edd
files xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/vcpu.c
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Wed Mar 15 08:22:03 2006 -0700
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Wed Mar 15 08:28:23 2006 -0700
     1.3 @@ -513,15 +513,15 @@ struct fake_acpi_tables {
     1.4  	struct acpi_table_header dsdt;
     1.5  	u8 aml[16];
     1.6  	struct acpi_table_madt madt;
     1.7 -	struct acpi_table_lsapic lsapic;
     1.8 +	struct acpi_table_lsapic lsapic[MAX_VIRT_CPUS];
     1.9  	u8 pm1a_evt_blk[4];
    1.10  	u8 pm1a_cnt_blk[1];
    1.11  	u8 pm_tmr_blk[4];
    1.12  };
    1.13  
    1.14  /* Create enough of an ACPI structure to make the guest OS ACPI happy. */
    1.15 -void
    1.16 -dom_fw_fake_acpi(struct fake_acpi_tables *tables)
    1.17 +static void
    1.18 +dom_fw_fake_acpi(struct domain *d, struct fake_acpi_tables *tables)
    1.19  {
    1.20  	struct acpi20_table_rsdp *rsdp = &tables->rsdp;
    1.21  	struct xsdt_descriptor_rev2 *xsdt = &tables->xsdt;
    1.22 @@ -529,7 +529,8 @@ dom_fw_fake_acpi(struct fake_acpi_tables
    1.23  	struct facs_descriptor_rev2 *facs = &tables->facs;
    1.24  	struct acpi_table_header *dsdt = &tables->dsdt;
    1.25  	struct acpi_table_madt *madt = &tables->madt;
    1.26 -	struct acpi_table_lsapic *lsapic = &tables->lsapic;
    1.27 +	struct acpi_table_lsapic *lsapic = tables->lsapic;
    1.28 +	int i;
    1.29  
    1.30  	memset(tables, 0, sizeof(struct fake_acpi_tables));
    1.31  
    1.32 @@ -621,16 +622,20 @@ dom_fw_fake_acpi(struct fake_acpi_tables
    1.33  	strncpy(madt->header.signature, APIC_SIG, 4);
    1.34  	madt->header.revision = 2;
    1.35  	madt->header.length = sizeof(struct acpi_table_madt) +
    1.36 -	                      sizeof(struct acpi_table_lsapic);
    1.37 +		MAX_VIRT_CPUS * sizeof(struct acpi_table_lsapic);
    1.38  	strcpy(madt->header.oem_id, "XEN");
    1.39  	strcpy(madt->header.oem_table_id, "Xen/ia64");
    1.40  	strcpy(madt->header.asl_compiler_id, "XEN");
    1.41  	madt->header.asl_compiler_revision = (XEN_VERSION<<16)|(XEN_SUBVERSION);
    1.42  
    1.43 -	/* A single LSAPIC entry describes the CPU.  Revisit for SMP guests */
    1.44 -	lsapic->header.type = ACPI_MADT_LSAPIC;
    1.45 -	lsapic->header.length = sizeof(struct acpi_table_lsapic);
    1.46 -	lsapic->flags.enabled = 1;
    1.47 +	/* An LSAPIC entry describes a CPU.  */
    1.48 +	for (i = 0; i < MAX_VIRT_CPUS; i++) {
    1.49 +		lsapic[i].header.type = ACPI_MADT_LSAPIC;
    1.50 +		lsapic[i].header.length = sizeof(struct acpi_table_lsapic);
    1.51 +		lsapic[i].id = i;
    1.52 +		lsapic[i].eid = 0;
    1.53 +		lsapic[i].flags.enabled = (d->vcpu[i] != NULL);
    1.54 +	}
    1.55  
    1.56  	madt->header.checksum = generate_acpi_checksum(madt,
    1.57  	                                               madt->header.length);
    1.58 @@ -784,7 +789,7 @@ dom_fw_init (struct domain *d, char *arg
    1.59  
    1.60  			acpi_tables = (void *)cp;
    1.61  			cp += sizeof(struct fake_acpi_tables);
    1.62 -			dom_fw_fake_acpi(acpi_tables);
    1.63 +			dom_fw_fake_acpi(d, acpi_tables);
    1.64  
    1.65  			efi_tables[i].guid = ACPI_20_TABLE_GUID;
    1.66  			efi_tables[i].table = dom_pa((unsigned long) acpi_tables);
     2.1 --- a/xen/arch/ia64/xen/vcpu.c	Wed Mar 15 08:22:03 2006 -0700
     2.2 +++ b/xen/arch/ia64/xen/vcpu.c	Wed Mar 15 08:28:23 2006 -0700
     2.3 @@ -726,12 +726,12 @@ UINT64 vcpu_deliverable_timer(VCPU *vcpu
     2.4  
     2.5  IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval)
     2.6  {
     2.7 -//extern unsigned long privop_trace;
     2.8 -//privop_trace=1;
     2.9 -	//TODO: Implement this
    2.10 -	printf("vcpu_get_lid: WARNING: Getting cr.lid always returns zero\n");
    2.11 -	//*pval = 0;
    2.12 -	*pval = ia64_getreg(_IA64_REG_CR_LID);
    2.13 +	/* Use real LID for domain0 until vIOSAPIC is present.
    2.14 +	   Use EID=0, ID=vcpu_id for domU.  */
    2.15 +	if (vcpu->domain == dom0)
    2.16 +		*pval = ia64_getreg(_IA64_REG_CR_LID);
    2.17 +	else
    2.18 +		*pval = vcpu->vcpu_id << 24;
    2.19  	return IA64_NO_FAULT;
    2.20  }
    2.21